Hacker News new | ask | show | jobs
by gadrev 1822 days ago
I see usages of fgets in Ch4, not bare gets (didn't check thoroughly)

    /* Read a line of user input of maximum size 2048 */
    fgets(input, 2048, stdin);
So that fgets does not read in too much data we also must also supply the size of the buffer 2048.

Maybe they updated? Also I'd understand not trying to be 100% safe in the code here to make the code easier to read, unlike in a production version of the tool.