Wednesday, August 24, 2011

Stupidest C Bug Ever?

Can you spot the bug in this code fragment?
if (code == 200) {     // Downloading whole file
    /* Write new file (plus allow reading once we finish) */
    // FIXME Win32 native version fails here because Microsoft's version of tmpfile() creates the file in C:\
    g = fname ? fopen(fname, "w+") : tmpfile();
}
Explanation here...

No comments:

Post a Comment