aboutsummaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorDavid <dbphillipsnz@gmail.com>2014-09-27 13:03:09 +1200
committerDavid <dbphillipsnz@gmail.com>2014-09-27 13:03:09 +1200
commit432a446a7b3a6fa9ce8736bffbbe48daea578feb (patch)
tree12fc88b1b30f42b6932cd0a076dc3456868587d7 /common.c
parent54242903bd3c85e2f4bef5de10ff818480b17404 (diff)
downloadparamano-432a446a7b3a6fa9ce8736bffbbe48daea578feb.tar.xz
Fixed bug affecting CPUs with multiple cores
Diffstat (limited to 'common.c')
-rw-r--r--common.c11
1 files changed, 11 insertions, 0 deletions
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';
+}