fgets() is a safe function to read a line of input, but it stores the new line byte '\n' read from the file in the array if it fits.
In many if not most cases, this new line must be removed before further processing the line contents.
Several simple methods can be used for that, but I have seen a compact and tricky proposal:
strtok(line, "\n"); // strip the newline
Why is this method incorrect and why does it not always work?