Subject: Hint on sp1 (This message is being sent to CPSC 215 Students and TA's) The value returned by sscanf() with %d format codes can be viewed separate cases: -1 => there was nothing but whitespace characters between the start of buffer pointer and the NULL at the end of the string 0 => there was some non-whitespace but the first field encountered was not a decimal number >0 => one or more numeric fields was successfully obtained. Therefore, if your .ppm header looks like P6 1024 768 255 and you use count = sscanf(buf + 2, "....") you will set count to -1 which is a BAD THING!!!!!!!!!! Thus it is advisable to do something along the lines of status = sscanf(...); if (status > 0) count += status;