projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* patch #3966: Create a mh_xmalloc function to prevent mistakes when
[mmh]
/
sbr
/
brkstring.c
diff --git
a/sbr/brkstring.c
b/sbr/brkstring.c
index
27f187e
..
255abf7
100644
(file)
--- a/
sbr/brkstring.c
+++ b/
sbr/brkstring.c
@@
-11,6
+11,7
@@
*/
#include <h/mh.h>
*/
#include <h/mh.h>
+#include <h/utils.h>
/* allocate this number of pointers at a time */
#define NUMBROKEN 256
/* allocate this number of pointers at a time */
#define NUMBROKEN 256
@@
-33,8
+34,7
@@
brkstring (char *str, char *brksep, char *brkterm)
/* allocate initial space for pointers on first call */
if (!broken) {
len = NUMBROKEN;
/* allocate initial space for pointers on first call */
if (!broken) {
len = NUMBROKEN;
- if (!(broken = (char **) malloc ((size_t) (len * sizeof(*broken)))))
- adios (NULL, "unable to malloc array in brkstring");
+ broken = (char **) mh_xmalloc ((size_t) (len * sizeof(*broken)));
}
/*
}
/*