Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

fucking buffer boundaries

Name: Anonymous 2010-12-28 7:18

./shit.c:284: Medium: fgetc
Check buffer boundaries if calling this function in a loop
and make sure you are not in danger of writing past the allocated space.

./shit.c:284:9:  [1] (buffer) fgetc:
Check buffer boundaries if used in a loop.


/* there's a reason for using this sizing, don't hate */
unsigned int textfilesize(FILE *stream)
{
 auto unsigned int counter;
 counter = 0;
 while (fgetc(stream) != EOF)
  counter++;
 rewind(stream);  /* fseek(stream, 0L, SEEK_SET); */
 return counter;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List