X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fgetarguments.c;h=e8da9849b8eaad0b25b63068c721f97d080a8996;hp=ce33c2eaec9fecccd94394ce192a7d02f881c428;hb=431604647f89d5aac7b199a7883e98e56e4ccf9e;hpb=714b5c530ece27ea2835a313013f5b770163403c diff --git a/sbr/getarguments.c b/sbr/getarguments.c index ce33c2e..e8da984 100644 --- a/sbr/getarguments.c +++ b/sbr/getarguments.c @@ -19,7 +19,7 @@ getarguments(char *invo_name, int argc, char **argv, int check_context) ** Check if profile/context specifies any arguments */ if (check_context && (cp = context_find(invo_name))) { - cp = getcpy(cp); /* make copy */ + cp = mh_xstrdup(cp); /* make copy */ ap = brkstring(cp, " ", "\n"); /* split string */ /* Count number of arguments split */ @@ -28,14 +28,14 @@ getarguments(char *invo_name, int argc, char **argv, int check_context) n++; } - arguments = (char **) mh_xmalloc((argc + n) * sizeof(*arguments)); + arguments = mh_xcalloc(argc + n, sizeof(*arguments)); bp = arguments; /* Copy any arguments from profile/context */ if (ap != NULL && n > 0) { while (*ap) *bp++ = *ap++; - } + } /* Copy arguments from command line */ argv++;