From: mquinson Date: Mon, 30 Apr 2007 20:37:17 +0000 (+0000) Subject: Make sure we don't went out of the string to handle *before* using it (thx valgrind) X-Git-Tag: v3.3~1891 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/af65faa449b38729c5419a84426def9228083b8c Make sure we don't went out of the string to handle *before* using it (thx valgrind) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3469 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/xbt/xbt_str.c b/src/xbt/xbt_str.c index 973ac6a47b..aa61389215 100644 --- a/src/xbt/xbt_str.c +++ b/src/xbt/xbt_str.c @@ -60,7 +60,7 @@ xbt_str_rtrim(char* s, const char* char_list) while(*cur) ++cur; - while(white_char[(unsigned char)*cur] && (cur >= s)) + while((cur >= s) && white_char[(unsigned char)*cur]) --cur; *++cur = '\0';