Created
February 28, 2016 09:00
-
-
Save maxtortime/8964de740aec6a44c716 to your computer and use it in GitHub Desktop.
Remove trailing new line after fgets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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