From 432a446a7b3a6fa9ce8736bffbbe48daea578feb Mon Sep 17 00:00:00 2001 From: David Date: Sat, 27 Sep 2014 13:03:09 +1200 Subject: Fixed bug affecting CPUs with multiple cores --- common.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common.c') diff --git a/common.c b/common.c index 231ad50..a85efd3 100644 --- a/common.c +++ b/common.c @@ -93,3 +93,14 @@ int get_int(const char* string) return atoi(first_num); } + + +/*********************************************************************** + * Replace occurrences of \n from end of string with \0 + **********************************************************************/ +void chomp(char* string) +{ + int i; + for (i = strlen(string)-1; (i >= 0 && string[i] == '\n'); i--) + string[i] = '\0'; +} -- cgit v1.1