projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
multiply buffer size by MB_CUR_MAX so multi-byte chars fit
[mmh]
/
uip
/
anno.c
diff --git
a/uip/anno.c
b/uip/anno.c
index
dca93eb
..
9fbb37f
100644
(file)
--- a/
uip/anno.c
+++ b/
uip/anno.c
@@
-46,6
+46,7
@@
*/
#include <h/mh.h>
*/
#include <h/mh.h>
+#include <h/utils.h>
/*
* We allocate space for messages (msgs array)
/*
* We allocate space for messages (msgs array)
@@
-127,8
+128,7
@@
main (int argc, char **argv)
*/
nummsgs = 0;
maxmsgs = MAXMSGS;
*/
nummsgs = 0;
maxmsgs = MAXMSGS;
- if (!(msgs = (char **) malloc ((size_t) (maxmsgs * sizeof(*msgs)))))
- adios (NULL, "unable to allocate storage");
+ msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
while ((cp = *argp++)) {
if (*cp == '-') {
while ((cp = *argp++)) {
if (*cp == '-') {
@@
-233,9
+233,8
@@
main (int argc, char **argv)
*/
if (nummsgs >= maxmsgs) {
maxmsgs += MAXMSGS;
*/
if (nummsgs >= maxmsgs) {
maxmsgs += MAXMSGS;
- if (!(msgs = (char **) realloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)))))
- adios (NULL, "unable to reallocate msgs storage");
+ msgs = (char **) mh_xrealloc (msgs,
+ (size_t) (maxmsgs * sizeof(*msgs)));
}
msgs[nummsgs++] = cp;
}
}
msgs[nummsgs++] = cp;
}