Skip to content

Instantly share code, notes, and snippets.

@benwills
Created December 27, 2014 09:29
Show Gist options
  • Select an option

  • Save benwills/077d396ab8cf3a771425 to your computer and use it in GitHub Desktop.

Select an option

Save benwills/077d396ab8cf3a771425 to your computer and use it in GitHub Desktop.
Chomp Line in C
//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