Skip to content

Instantly share code, notes, and snippets.

@maxtortime
Created February 28, 2016 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxtortime/8964de740aec6a44c716 to your computer and use it in GitHub Desktop.
Save maxtortime/8964de740aec6a44c716 to your computer and use it in GitHub Desktop.
Remove trailing new line after fgets
/* Remove trailing newline, . */
if ((strlen(name)>0) && (name[strlen (name) - 1] == '\n'))
name[strlen (name) - 1] = '\0';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment