aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/dump.c2
-rw-r--r--libbb/find_root_device.c7
-rw-r--r--libbb/sha1.c2
-rw-r--r--libbb/vfork_daemon_rexec.c8
4 files changed, 8 insertions, 11 deletions
diff --git a/libbb/dump.c b/libbb/dump.c
index 06b73c955..1815ca914 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -726,7 +726,7 @@ void bb_dump_add(const char *fmt)
if (isdigit(*p)) {
// TODO: use bb_strtou
savep = p;
- do p++; while(isdigit(*p));
+ do p++; while (isdigit(*p));
if (!isspace(*p)) {
bb_error_msg_and_die("bad format {%s}", fmt);
}
diff --git a/libbb/find_root_device.c b/libbb/find_root_device.c
index 71b79b8d0..1d74d1ea8 100644
--- a/libbb/find_root_device.c
+++ b/libbb/find_root_device.c
@@ -17,12 +17,13 @@ char *find_block_device(char *path)
dev_t dev;
char *retpath=NULL;
- if(stat(path, &st) || !(dir = opendir("/dev"))) return NULL;
+ if (stat(path, &st) || !(dir = opendir("/dev")))
+ return NULL;
dev = (st.st_mode & S_IFMT) == S_IFBLK ? st.st_rdev : st.st_dev;
- while((entry = readdir(dir)) != NULL) {
+ while ((entry = readdir(dir)) != NULL) {
char devpath[PATH_MAX];
sprintf(devpath,"/dev/%s", entry->d_name);
- if(!stat(devpath, &st) && S_ISBLK(st.st_mode) && st.st_rdev == dev) {
+ if (!stat(devpath, &st) && S_ISBLK(st.st_mode) && st.st_rdev == dev) {
retpath = xstrdup(devpath);
break;
}
diff --git a/libbb/sha1.c b/libbb/sha1.c
index 34813e24a..734fde4c5 100644
--- a/libbb/sha1.c
+++ b/libbb/sha1.c
@@ -47,7 +47,7 @@
do { \
t = a; a = rotl32(a,5) + f(b,c,d) + e + k + w[i]; \
e = d; d = c; c = rotl32(b, 30); b = t; \
- } while(0)
+ } while (0)
static void sha1_compile(sha1_ctx_t *ctx)
{
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index ebd32f8cd..81ae12687 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -15,13 +15,9 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
#include <paths.h>
#include "libbb.h"
-
#ifdef BB_NOMMU
void vfork_daemon_rexec(int nochdir, int noclose,
int argc, char **argv, char *foreground_opt)
@@ -43,9 +39,9 @@ void vfork_daemon_rexec(int nochdir, int noclose,
close(fd);
}
- vfork_args = xcalloc(sizeof(char *), argc + 3);
+ vfork_args = xzalloc(sizeof(char *) * (argc + 3));
vfork_args[a++] = CONFIG_BUSYBOX_EXEC_PATH;
- while(*argv) {
+ while (*argv) {
vfork_args[a++] = *argv;
argv++;
}