Search found 1 match

by gtbass
Sun Oct 01, 2006 12:46 am
Forum: Volume 102 (10200-10299)
Topic: 10258 - Contest Scoreboard
Replies: 87
Views: 48274

when gets(str) reaches the EOF, it returns 0, which is passed to strlen() as a null pointer. To fix, do this instead:

Code: Select all

while(gets(str) && strlen(str)) {...}

Go to advanced search