summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2006-10-12 19:29:44 +0000
committerDenis Vlasenko2006-10-12 19:29:44 +0000
commita6dbb08a48903cb8f31fad2cf2d1cffa92bd4808 (patch)
treef7f2113941a2dc0385080baa7656ead41f45f834
parent12f5676cce3b2e04668df3f18f94f1a3c7fdbb9e (diff)
downloadbusybox-a6dbb08a48903cb8f31fad2cf2d1cffa92bd4808.zip
busybox-a6dbb08a48903cb8f31fad2cf2d1cffa92bd4808.tar.gz
small style fixes
-rw-r--r--archival/dpkg.c10
-rw-r--r--archival/tar.c2
-rw-r--r--editors/patch.c6
-rw-r--r--libbb/fgets_str.c8
-rw-r--r--libbb/procps.c3
-rw-r--r--libbb/xfuncs.c3
-rw-r--r--networking/ftpgetput.c2
-rw-r--r--networking/udhcp/dhcpc.c6
8 files changed, 24 insertions, 16 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c
index b558224..825a8c1 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -878,7 +878,8 @@ static void write_status_file(deb_file_t **deb_file)
/* remove trailing \n's */
write_buffer_no_status(new_status_file, deb_file[i]->control_file);
set_status(status_num, "ok", 2);
- fprintf(new_status_file, "Status: %s\n\n", name_hashtable[status_hashtable[status_num]->status]);
+ fprintf(new_status_file, "Status: %s\n\n",
+ name_hashtable[status_hashtable[status_num]->status]);
write_flag = TRUE;
break;
}
@@ -886,7 +887,9 @@ static void write_status_file(deb_file_t **deb_file)
}
/* This is temperary, debugging only */
if (deb_file[i] == NULL) {
- bb_error_msg_and_die("ALERT: Couldnt find a control file, your status file may be broken, status may be incorrect for %s", package_name);
+ bb_error_msg_and_die("ALERT: cannot find a control file, "
+ "your status file may be broken, status may be "
+ "incorrect for %s", package_name);
}
}
else if (strcmp("not-installed", name_hashtable[state_status]) == 0) {
@@ -963,7 +966,8 @@ static void write_status_file(deb_file_t **deb_file)
}
if (rename("/var/lib/dpkg/status.udeb", "/var/lib/dpkg/status") == -1) {
- bb_error_msg_and_die("DANGER: Cannot create status file, you need to manually repair your status file");
+ bb_error_msg_and_die("DANGER: cannot create status file, "
+ "you need to manually repair your status file");
}
}
diff --git a/archival/tar.c b/archival/tar.c
index 28bb147..5ebb3df 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -499,7 +499,7 @@ static int writeTarFile(const int tar_fd, const int verboseFlag,
bb_error_msg("Error exit delayed from previous errors");
if (gzipPid && waitpid(gzipPid, NULL, 0)==-1)
- bb_error_msg("Couldnt wait");
+ bb_error_msg("cannot wait");
return !errorFlag;
}
diff --git a/editors/patch.c b/editors/patch.c
index 047de9e..9336b27 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -147,7 +147,7 @@ int patch_main(int argc, char **argv)
strcpy(backup_filename, new_filename);
strcat(backup_filename, ".orig");
if (rename(new_filename, backup_filename) == -1) {
- bb_perror_msg_and_die("Couldnt create file %s",
+ bb_perror_msg_and_die("cannot create file %s",
backup_filename);
}
dst_stream = xfopen(new_filename, "w");
@@ -256,10 +256,10 @@ int patch_main(int argc, char **argv)
if ((dest_cur_line == 0) || (dest_beg_line == 0)) {
/* The new patched file is empty, remove it */
if (unlink(new_filename) == -1) {
- bb_perror_msg_and_die("Couldnt remove file %s", new_filename);
+ bb_perror_msg_and_die("cannot remove file %s", new_filename);
}
if (unlink(original_filename) == -1) {
- bb_perror_msg_and_die("Couldnt remove original file %s", new_filename);
+ bb_perror_msg_and_die("cannot remove original file %s", new_filename);
}
}
}
diff --git a/libbb/fgets_str.c b/libbb/fgets_str.c
index 8f06fa5..41370d1 100644
--- a/libbb/fgets_str.c
+++ b/libbb/fgets_str.c
@@ -44,12 +44,14 @@ char *fgets_str(FILE *file, const char *terminating_string)
/* Check for terminating string */
end_string_offset = idx - term_length;
- if ((end_string_offset > 0) && (memcmp(&linebuf[end_string_offset], terminating_string, term_length) == 0)) {
+ if (end_string_offset > 0
+ && memcmp(&linebuf[end_string_offset], terminating_string, term_length) == 0
+ ) {
idx -= term_length;
break;
}
}
+ linebuf = xrealloc(linebuf, idx + 1);
linebuf[idx] = '\0';
- return(linebuf);
+ return linebuf;
}
-
diff --git a/libbb/procps.c b/libbb/procps.c
index 8fd5c1f..2bcd2cc 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -54,7 +54,8 @@ procps_status_t * procps_scan(int save_user_arg0)
dir = xopendir("/proc");
}
for (;;) {
- if ((entry = readdir(dir)) == NULL) {
+ entry = readdir(dir);
+ if (entry == NULL) {
closedir(dir);
dir = 0;
return 0;
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index 8428110..d22cd27 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -137,7 +137,8 @@ void xwrite(int fd, void *buf, size_t count)
// Die with an error message if we can't lseek to the right spot.
void xlseek(int fd, off_t offset, int whence)
{
- if (offset != lseek(fd, offset, whence)) bb_error_msg_and_die("lseek");
+ if (offset != lseek(fd, offset, whence))
+ bb_error_msg_and_die("lseek");
}
// Die with an error message if we can't read one character.
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 5d13e28..47126ee 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -78,7 +78,7 @@ static FILE *ftp_login(ftp_host_info_t *server)
/* Connect to the command socket */
control_stream = fdopen(xconnect(server->s_in), "r+");
if (control_stream == NULL) {
- bb_perror_msg_and_die("Couldnt open control stream");
+ bb_perror_msg_and_die("cannot open control stream");
}
if (ftpcmd(NULL, NULL, control_stream, buf) != 220) {
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index f2cf82f..e2ddf4f 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -448,7 +448,7 @@ int udhcpc_main(int argc, char *argv[])
}
if ((message = get_option(&packet, DHCP_MESSAGE_TYPE)) == NULL) {
- bb_error_msg("Couldnt get option from packet - ignoring");
+ bb_error_msg("cannot get option from packet - ignoring");
continue;
}
@@ -467,7 +467,7 @@ int udhcpc_main(int argc, char *argv[])
timeout = now;
packet_num = 0;
} else {
- bb_error_msg("No server ID in message");
+ bb_error_msg("no server ID in message");
}
}
break;
@@ -478,7 +478,7 @@ int udhcpc_main(int argc, char *argv[])
if (*message == DHCPACK) {
temp = get_option(&packet, DHCP_LEASE_TIME);
if (!temp) {
- bb_error_msg("No lease time with ACK, using 1 hour lease");
+ bb_error_msg("no lease time with ACK, using 1 hour lease");
lease = 60 * 60;
} else {
lease = ntohl(*(uint32_t*)temp);