projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove trailing newlines from components to fix bug with spaces at the end of
[mmh]
/
uip
/
rmm.c
diff --git
a/uip/rmm.c
b/uip/rmm.c
index
072097a
..
b9fd80d
100644
(file)
--- a/
uip/rmm.c
+++ b/
uip/rmm.c
@@
-10,6
+10,7
@@
*/
#include <h/mh.h>
*/
#include <h/mh.h>
+#include <h/utils.h>
/*
* We allocate space for message names and ranges
/*
* We allocate space for message names and ranges
@@
-56,8
+57,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)));
/* parse arguments */
while ((cp = *argp++)) {
/* parse arguments */
while ((cp = *argp++)) {
@@
-98,9
+98,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;
}