X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fputenv.c;h=54c40684e8e80c9ece9e766d7312860f8e69fe4d;hp=a2ec7d3a91d8ade38c2b83a4c69b9d9fb96c8329;hb=10eff860a28b96582526eb739fd0a55441669938;hpb=d6742b1bb19c7eca8488402484a6e4f55543d789 diff --git a/sbr/putenv.c b/sbr/putenv.c index a2ec7d3..54c4068 100644 --- a/sbr/putenv.c +++ b/sbr/putenv.c @@ -25,7 +25,7 @@ m_putenv(char *name, char *value) int i; char **ep, **nep, *cp; - cp = mh_xmalloc((size_t) (strlen(name) + strlen(value) + 2)); + cp = mh_xcalloc((size_t) (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 = (char **) mh_xcalloc((size_t) (i + 2), sizeof(*nep)); for (ep = environ, i = 0; *ep; nep[i++] = *ep++) continue;