mirror of
https://github.com/troglobit/libite.git
synced 2026-10-12 10:12:22 +00:00
chomp: Check for beginning of string while removing \n's
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@ char *chomp(char *str)
|
||||
}
|
||||
|
||||
p = str + strlen(str) - 1;
|
||||
while (*p == '\n')
|
||||
while (p >= str && *p == '\n')
|
||||
*p-- = 0;
|
||||
|
||||
return str;
|
||||
|
||||
Reference in New Issue
Block a user