aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbb/getopt32.c2
-rw-r--r--libbb/procps.c18
2 files changed, 7 insertions, 13 deletions
diff --git a/libbb/getopt32.c b/libbb/getopt32.c
index 318f08059..2452eb0a5 100644
--- a/libbb/getopt32.c
+++ b/libbb/getopt32.c
@@ -30,7 +30,7 @@ getopt32(char **argv, const char *applet_opts, ...)
30 30
31 "r" will add 1 (bit 0) 31 "r" will add 1 (bit 0)
32 "n" will add 2 (bit 1) 32 "n" will add 2 (bit 1)
33 "u will add 4 (bit 2) 33 "u" will add 4 (bit 2)
34 "g" will add 8 (bit 3) 34 "g" will add 8 (bit 3)
35 35
36 and so on. You can also look at the return value as a bit 36 and so on. You can also look at the return value as a bit
diff --git a/libbb/procps.c b/libbb/procps.c
index 3a31eeff3..f1c0b6d27 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -353,14 +353,10 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags)
353 353
354#if 0 /* PSSCAN_CMD is not used */ 354#if 0 /* PSSCAN_CMD is not used */
355 if (flags & (PSSCAN_CMD|PSSCAN_ARGV0)) { 355 if (flags & (PSSCAN_CMD|PSSCAN_ARGV0)) {
356 if (sp->argv0) { 356 free(sp->argv0);
357 free(sp->argv0); 357 sp->argv0 = NULL;
358 sp->argv0 = NULL; 358 free(sp->cmd);
359 } 359 sp->cmd = NULL;
360 if (sp->cmd) {
361 free(sp->cmd);
362 sp->cmd = NULL;
363 }
364 strcpy(filename_tail, "/cmdline"); 360 strcpy(filename_tail, "/cmdline");
365 /* TODO: to get rid of size limits, read into malloc buf, 361 /* TODO: to get rid of size limits, read into malloc buf,
366 * then realloc it down to real size. */ 362 * then realloc it down to real size. */
@@ -380,10 +376,8 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags)
380 } 376 }
381#else 377#else
382 if (flags & PSSCAN_ARGV0) { 378 if (flags & PSSCAN_ARGV0) {
383 if (sp->argv0) { 379 free(sp->argv0);
384 free(sp->argv0); 380 sp->argv0 = NULL;
385 sp->argv0 = NULL;
386 }
387 strcpy(filename_tail, "/cmdline"); 381 strcpy(filename_tail, "/cmdline");
388 n = read_to_buf(filename, buf); 382 n = read_to_buf(filename, buf);
389 if (n <= 0) 383 if (n <= 0)