From e20ebd5fc3c7b5fcf166a4040046eed9ba01017a Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 13 Nov 2012 12:33:46 +0100 Subject: [PATCH] Fixing users of --- src/plugins/cvs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/cvs.c b/src/plugins/cvs.c index a23521d..f1b4230 100644 --- a/src/plugins/cvs.c +++ b/src/plugins/cvs.c @@ -999,11 +999,15 @@ static gboolean _cvs_task_on_io_can_read(GIOChannel * channel, /* rtrim */ static void _rtrim(char * string) { + unsigned char * s = (unsigned char *)string; size_t i; - int c; - if(string == NULL || (i = strlen(string)) == 0) + if(s == NULL || (i = strlen(string)) == 0) return; - for(i--; i > 0 && (c = string[i]) != '\0' && isspace(c); i--) + for(i--; s[i] != '\0' && isspace(s[i]); i--) + { string[i] = '\0'; + if(i == 0) + break; + } }