Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Do not call strcpy but memmove since both zone may overlap. Thanks valgrind for reporting
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 29 Apr 2007 11:36:01 +0000 (11:36 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 29 Apr 2007 11:36:01 +0000 (11:36 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3468 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/xbt_str.c

index 11a50b8..973ac6a 100644 (file)
@@ -108,7 +108,7 @@ xbt_str_ltrim( char* s, const char* char_list)
        while(*cur && white_char[(unsigned char)*cur])
                ++cur;
 
-       return strcpy(s,cur);
+       return memmove(s,cur, strlen(cur));
 }
 
 /**  @brief Strip whitespace (or other characters) from the end and the begining of a string.