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
Use xbt_malloc (and friends) instead of direct malloc()
[simgrid.git]
/
src
/
xbt
/
xbt_str.c
diff --git
a/src/xbt/xbt_str.c
b/src/xbt/xbt_str.c
index e4ea1849e69d94d20ca8da0b281fff4d74d15501..4c361b594faad459bfff97c4da2959639af03b34 100644
(file)
--- a/
src/xbt/xbt_str.c
+++ b/
src/xbt/xbt_str.c
@@
-305,14
+305,14
@@
xbt_dynar_t xbt_str_split_str(const char *s, const char *sep)
//if substring was not found add the entire string
if (NULL == q) {
v = strlen(p);
//if substring was not found add the entire string
if (NULL == q) {
v = strlen(p);
- to_push = malloc(v + 1);
+ to_push =
xbt_
malloc(v + 1);
memcpy(to_push, p, v);
to_push[v] = '\0';
xbt_dynar_push(res, &to_push);
done = 1;
} else {
//get the appearance
memcpy(to_push, p, v);
to_push[v] = '\0';
xbt_dynar_push(res, &to_push);
done = 1;
} else {
//get the appearance
- to_push = malloc(q - p + 1);
+ to_push =
xbt_
malloc(q - p + 1);
memcpy(to_push, p, q - p);
//add string terminator
to_push[q - p] = '\0';
memcpy(to_push, p, q - p);
//add string terminator
to_push[q - p] = '\0';