projects
/
rrdd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cbf9f74
)
src/rrdc.c: According to C99 argv is NULL terminated, so don't copy the array.
author
Florian Forster
<octo@verplant.org>
Sat, 21 Jun 2008 15:43:07 +0000
(17:43 +0200)
committer
Florian Forster
<octo@verplant.org>
Sat, 21 Jun 2008 15:43:07 +0000
(17:43 +0200)
src/rrdc.c
patch
|
blob
|
history
diff --git
a/src/rrdc.c
b/src/rrdc.c
index
65c9912
..
eae16a1
100644
(file)
--- a/
src/rrdc.c
+++ b/
src/rrdc.c
@@
-78,24
+78,13
@@
int main (int argc, char **argv)
}
else
{
}
else
{
- char **argv_copy;
-
fprintf (stdout, "RRDc 1.0.0 Copyright 2008 by Florian Forster "
"<octo at verplant.org>\n\n");
fflush (stdout);
fprintf (stdout, "RRDc 1.0.0 Copyright 2008 by Florian Forster "
"<octo at verplant.org>\n\n");
fflush (stdout);
- /* Copy argv so we can assure that it is NULL terminated. */
- argv_copy = (char **) malloc (sizeof (char *) * (argc + 1));
- if (argv_copy == NULL)
- {
- fprintf (stderr, "malloc failed.\n");
- return (1);
- }
- memcpy (argv_copy, argv, sizeof (char *) * argc);
- /* argv_copy[0] = "rrdtool"; */
- argv_copy[argc] = NULL;
+ assert (argv[argc] == NULL);
- status = execvp ("rrdtool", argv
_copy
);
+ status = execvp ("rrdtool", argv);
fprintf (stderr, "execv failed with status %i.\n", status);
return (1);
}
fprintf (stderr, "execv failed with status %i.\n", status);
return (1);
}