I was under the impression that BUFSIZ is the size of the buffer, however, if you declare an array and make it's size bufsiz, then use fgets(array, BUFSIZ, stdin); it still seems possible to overflow the buffer. But if BUFSIZ is the size of the buffer, why doesn't this prevent overflowing it?
Also, another small question:
Code:
while ((cb=getchar()) != EOF) {
if (cb == '<') {
printf("----------->");
putc(cb);
}
I was trying to make a program to help me out with something in another program I made, hence the code above. It's supposed to wait until the user types "<", then automatically change that to "<------------------>". but it doesn't work, and I was hoping someone might know why.
As always, thanks
--Ash