mhl and mhbuild ignore to long lines
[mmh] / sbr / putenv.c
index 5c7279b..c47f26e 100644 (file)
@@ -22,10 +22,10 @@ static int nvmatch(char *, char *);
 int
 m_putenv(char *name, char *value)
 {
-       register int i;
-       register char **ep, **nep, *cp;
+       int i;
+       char **ep, **nep, *cp;
 
-       cp = mh_xmalloc((size_t) (strlen(name) + strlen(value) + 2));
+       cp = mh_xcalloc(strlen(name) + strlen(value) + 2, sizeof(char));
 
        sprintf(cp, "%s=%s", name, value);
 
@@ -35,7 +35,7 @@ m_putenv(char *name, char *value)
                        return 0;
                }
 
-       nep = (char **) mh_xmalloc((size_t) ((i + 2) * sizeof(*nep)));
+       nep = mh_xcalloc(i + 2, sizeof(*nep));
 
        for (ep = environ, i = 0; *ep; nep[i++] = *ep++)
                continue;