Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#23 mail outfile and more than 10000 files

closed-fixed
General (9)
2
2002-08-29
2002-07-28
Peter Palfrader
No

mail.c: sendmail()

this code probably breaks in an ungly way if one
reaches the out10000.txt file.

for (i = 0; i < 10000; i++) {
sprintf(path, "%s%cout%i.txt", POOLDIR, DIRSEP, i);
f = fopen(path, "r");
if (f)
fclose(f);
else
break;
}
f = fopen(path, "w");
if (f != NULL) {
err = buf_write(head, f);
err = buf_write(message, f);
fclose(f);
} else
errlog(ERRORMSG, "Can't create %s!\n", path);

Discussion

  • Len Sassaman
    Len Sassaman
    2002-08-28

    • assigned_to: nobody --> weaselp
     
    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=1525

    using maildir style filenames solves the issue