A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure we don't went out of the string to handle *before* using it (thx valgrind)
[simgrid.git]
/
src
/
xbt
/
xbt_str.c
diff --git
a/src/xbt/xbt_str.c
b/src/xbt/xbt_str.c
index
11a50b8
..
aa61389
100644
(file)
--- 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(*cur)
++cur;
- while(
white_char[(unsigned char)*cur] && (cur >= s)
)
+ while(
(cur >= s) && white_char[(unsigned char)*cur]
)
--cur;
*++cur = '\0';
--cur;
*++cur = '\0';
@@
-108,7
+108,7
@@
xbt_str_ltrim( char* s, const char* char_list)
while(*cur && white_char[(unsigned char)*cur])
++cur;
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.
}
/** @brief Strip whitespace (or other characters) from the end and the begining of a string.