diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-10-12 19:29:44 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-10-12 19:29:44 +0000 |
commit | 6b56f335a77c453fc44157fe5a223c2bf54df5d9 (patch) | |
tree | f7f2113941a2dc0385080baa7656ead41f45f834 /libbb | |
parent | d6327ac14f6040a081b55b34230acfb370ced3f8 (diff) | |
download | busybox-w32-6b56f335a77c453fc44157fe5a223c2bf54df5d9.tar.gz busybox-w32-6b56f335a77c453fc44157fe5a223c2bf54df5d9.tar.bz2 busybox-w32-6b56f335a77c453fc44157fe5a223c2bf54df5d9.zip |
small style fixes
git-svn-id: svn://busybox.net/trunk/busybox@16371 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/fgets_str.c | 8 | ||||
-rw-r--r-- | libbb/procps.c | 3 | ||||
-rw-r--r-- | libbb/xfuncs.c | 3 |
3 files changed, 9 insertions, 5 deletions
diff --git a/libbb/fgets_str.c b/libbb/fgets_str.c index 8f06fa59c..41370d176 100644 --- a/libbb/fgets_str.c +++ b/libbb/fgets_str.c | |||
@@ -44,12 +44,14 @@ char *fgets_str(FILE *file, const char *terminating_string) | |||
44 | 44 | ||
45 | /* Check for terminating string */ | 45 | /* Check for terminating string */ |
46 | end_string_offset = idx - term_length; | 46 | end_string_offset = idx - term_length; |
47 | if ((end_string_offset > 0) && (memcmp(&linebuf[end_string_offset], terminating_string, term_length) == 0)) { | 47 | if (end_string_offset > 0 |
48 | && memcmp(&linebuf[end_string_offset], terminating_string, term_length) == 0 | ||
49 | ) { | ||
48 | idx -= term_length; | 50 | idx -= term_length; |
49 | break; | 51 | break; |
50 | } | 52 | } |
51 | } | 53 | } |
54 | linebuf = xrealloc(linebuf, idx + 1); | ||
52 | linebuf[idx] = '\0'; | 55 | linebuf[idx] = '\0'; |
53 | return(linebuf); | 56 | return linebuf; |
54 | } | 57 | } |
55 | |||
diff --git a/libbb/procps.c b/libbb/procps.c index 8fd5c1f86..2bcd2cced 100644 --- a/libbb/procps.c +++ b/libbb/procps.c | |||
@@ -54,7 +54,8 @@ procps_status_t * procps_scan(int save_user_arg0) | |||
54 | dir = xopendir("/proc"); | 54 | dir = xopendir("/proc"); |
55 | } | 55 | } |
56 | for (;;) { | 56 | for (;;) { |
57 | if ((entry = readdir(dir)) == NULL) { | 57 | entry = readdir(dir); |
58 | if (entry == NULL) { | ||
58 | closedir(dir); | 59 | closedir(dir); |
59 | dir = 0; | 60 | dir = 0; |
60 | return 0; | 61 | return 0; |
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index 84281105c..d22cd279a 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c | |||
@@ -137,7 +137,8 @@ void xwrite(int fd, void *buf, size_t count) | |||
137 | // Die with an error message if we can't lseek to the right spot. | 137 | // Die with an error message if we can't lseek to the right spot. |
138 | void xlseek(int fd, off_t offset, int whence) | 138 | void xlseek(int fd, off_t offset, int whence) |
139 | { | 139 | { |
140 | if (offset != lseek(fd, offset, whence)) bb_error_msg_and_die("lseek"); | 140 | if (offset != lseek(fd, offset, whence)) |
141 | bb_error_msg_and_die("lseek"); | ||
141 | } | 142 | } |
142 | 143 | ||
143 | // Die with an error message if we can't read one character. | 144 | // Die with an error message if we can't read one character. |