Created
December 27, 2014 09:29
-
-
Save benwills/077d396ab8cf3a771425 to your computer and use it in GitHub Desktop.
Chomp Line in C
This file contains hidden or 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
| //https://github.com/bitly/dablooms/blob/master/src/test_dablooms.c | |
| static void chomp_line(char *word) | |
| { | |
| char *p; | |
| if ((p = strchr(word, '\r'))) { | |
| *p = '\0'; | |
| } | |
| if ((p = strchr(word, '\n'))) { | |
| *p = '\0'; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment