fix proc_args from breaking on zero-length arg
This commit is contained in:
parent
a08034ba34
commit
cac8fa29a6
|
@ -949,7 +949,7 @@ int sigar_proc_args_get(sigar_t *sigar, sigar_pid_t pid,
|
||||||
|
|
||||||
sigar_proc_args_create(procargs);
|
sigar_proc_args_create(procargs);
|
||||||
|
|
||||||
while (*ptr && (nargs-- > 0)) {
|
while ((ptr < end) && (nargs-- > 0)) {
|
||||||
int alen = strlen(ptr)+1;
|
int alen = strlen(ptr)+1;
|
||||||
char *arg = malloc(alen);
|
char *arg = malloc(alen);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue