projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Generate the command list in mmh-intro(7)
[mmh]
/
sbr
/
brkstring.c
diff --git
a/sbr/brkstring.c
b/sbr/brkstring.c
index
32dd37f
..
a9446fe
100644
(file)
--- a/
sbr/brkstring.c
+++ b/
sbr/brkstring.c
@@
-7,6
+7,7
@@
** complete copyright information.
*/
** complete copyright information.
*/
+#include <sysexits.h>
#include <h/mh.h>
#include <h/utils.h>
#include <h/mh.h>
#include <h/utils.h>
@@
-29,7
+30,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;
- broken = (char **)mh_xmalloc((size_t)(len * sizeof(*broken)));
+ broken = mh_xcalloc(len, sizeof(*broken));
}
/*
}
/*
@@
-41,8
+42,7
@@
brkstring(char *str, char *brksep, char *brkterm)
/* enlarge pointer array, if necessary */
if (i >= len) {
len += NUMBROKEN;
/* enlarge pointer array, if necessary */
if (i >= len) {
len += NUMBROKEN;
- broken = mh_xrealloc(broken,
- (size_t)(len * sizeof(*broken)));
+ broken = mh_xrealloc(broken, len * sizeof(*broken));
}
/* handle separators */
}
/* handle separators */
@@
-71,5
+71,5
@@
brkstring(char *str, char *brksep, char *brkterm)
}
}
}
}
}
}
- adios("brkstring()", "reached unreachable point");
+ adios(EX_SOFTWARE, "brkstring()", "reached unreachable point");
}
}