Trevor Johnson wrote:
 
> for (j = TRUE; (!(j == EOF) && (j)); j = fscanf(setfile,
> "%[^:]:%3u:%3u:%1c\n", tmpstring, &left, &right, &recplay)) {

Be warned that this can't handle garbage input. The %[^:] has no bonds
checking making tmpstring to overflow on garbage input. Not a big deal
unless the program is SUID.

A more safe way is to limit the field with of the string variable.
  char tmpstring[32];
  ...
  .... fscanf(setfile,"%32[^:]:...

---
Henrik Nordström

Reply via email to