Replace mh_xmalloc() with mh_xcalloc()
[mmh] / sbr / mf.c
index 69afff8..3134328 100644 (file)
--- a/sbr/mf.c
+++ b/sbr/mf.c
@@ -10,6 +10,9 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <h/utils.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
 
 /*
 ** static prototypes
@@ -27,7 +30,7 @@ static int my_lex(char *);
 static char *
 getcpy(char *s)
 {
-       register char *p;
+       char *p;
 
        if (!s) {
                /*
@@ -39,7 +42,7 @@ getcpy(char *s)
                for(;;)
                        pause();
        }
-       p = mh_xmalloc((size_t) (strlen(s) + 2));
+       p = mh_xcalloc((size_t) (strlen(s) + 2), sizeof(char));
        strcpy(p, s);
        return p;
 }
@@ -161,8 +164,8 @@ static struct adrx  adrxs2;
 struct adrx *
 getadrx(char *addrs)
 {
-       register char *bp;
-       register struct adrx *adrxp = &adrxs2;
+       char *bp;
+       struct adrx *adrxp = &adrxs2;
 
        if (pers)
                free(pers);
@@ -418,7 +421,7 @@ phrase(char *buffer)
 static int
 route_addr(char *buffer)
 {
-       register char *pp = cp;
+       char *pp = cp;
 
        if (my_lex(buffer) == LX_AT) {
                if (route(buffer) == NOTOK)
@@ -567,8 +570,8 @@ my_lex(char *buffer)
 {
        /* buffer should be at least BUFSIZ bytes long */
        int i;
-       register unsigned char c;
-       register char *bp;
+       unsigned char c;
+       char *bp;
 
        /*
        ** Add C to the buffer bp. After use of this macro *bp is guaranteed
@@ -708,7 +711,7 @@ char *
 legal_person(char *p)
 {
        int i;
-       register char *cp;
+       char *cp;
        static char buffer[BUFSIZ];
 
        if (*p == '"')