summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/process_escape_sequence.c9
-rw-r--r--libbb/vfork_daemon_rexec.c8
2 files changed, 8 insertions, 9 deletions
diff --git a/libbb/process_escape_sequence.c b/libbb/process_escape_sequence.c
index 138e751..3178ad3 100644
--- a/libbb/process_escape_sequence.c
+++ b/libbb/process_escape_sequence.c
@@ -8,9 +8,6 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <stdio.h>
-#include <limits.h>
-#include <ctype.h>
#include "libbb.h"
#define WANT_HEX_ESCAPES 1
@@ -46,10 +43,10 @@ char bb_process_escape_sequence(const char **ptr)
#endif
do {
- d = (unsigned int)(*q - '0');
+ d = (unsigned char)(*q) - '0';
#ifdef WANT_HEX_ESCAPES
if (d >= 10) {
- d = ((unsigned int)(_tolower(*q) - 'a')) + 10;
+ d = (unsigned char)(_tolower(*q)) - 'a' + 10;
}
#endif
@@ -80,7 +77,7 @@ char bb_process_escape_sequence(const char **ptr)
break;
}
} while (*++p);
- n = *(p+(sizeof(charmap)/2));
+ n = *(p + (sizeof(charmap)/2));
}
*ptr = q;
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index ec8b9b1..11dbb24 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -26,14 +26,16 @@ pid_t spawn(char **argv)
volatile int failed;
pid_t pid;
- // Be nice to nommu machines.
+// Ain't it a good place to fflush(NULL)?
+
+ /* Be nice to nommu machines. */
failed = 0;
pid = vfork();
if (pid < 0) /* error */
return pid;
if (!pid) { /* child */
- /* Don't use BB_EXECVP tricks here! */
- execvp(argv[0], argv);
+ /* This macro is ok - it doesn't do NOEXEC/NOFORK tricks */
+ BB_EXECVP(argv[0], argv);
/* We are (maybe) sharing a stack with blocked parent,
* let parent know we failed and then exit to unblock parent