summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenis Vlasenko2006-11-28 23:37:46 +0000
committerDenis Vlasenko2006-11-28 23:37:46 +0000
commit601ae1378ba7bb59e9c1a19fcc4ddd7bf9fb2e1b (patch)
tree79ad3707bb3374a2e429135ece7e604a26cde8c1 /networking
parentdf38188367a9fe10cc4efc00d3236be05178ff4e (diff)
downloadbusybox-601ae1378ba7bb59e9c1a19fcc4ddd7bf9fb2e1b.zip
busybox-601ae1378ba7bb59e9c1a19fcc4ddd7bf9fb2e1b.tar.gz
od: sometime ago I landed BIG od implementation
from coreutils. My fault. This commit contains cleanups and size reductions.
Diffstat (limited to 'networking')
-rw-r--r--networking/httpd.c16
-rw-r--r--networking/wget.c2
2 files changed, 11 insertions, 7 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 0de60ba..f95e0c0 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -671,7 +671,7 @@ static char *encodeString(const char *string)
*
* $Parameters:
* (char *) string . . . The first string to decode.
- * (int) flag . . . 1 if require decode '+' as ' ' for CGI
+ * (int) flag . . . 1 if need to decode '+' as ' ' for CGI
*
* $Return: (char *) . . . . A pointer to the decoded string (same as input).
*
@@ -685,14 +685,18 @@ static char *decodeString(char *orig, int flag_plus_to_space)
char *ptr = string;
while (*ptr) {
- if (*ptr == '+' && flag_plus_to_space) { *string++ = ' '; ptr++; }
- else if (*ptr != '%') *string++ = *ptr++;
- else {
+ if (*ptr == '+' && flag_plus_to_space) {
+ *string++ = ' ';
+ ptr++;
+ } else if (*ptr != '%') {
+ *string++ = *ptr++;
+ } else {
unsigned int value1, value2;
ptr++;
- if (sscanf(ptr, "%1X", &value1) != 1 ||
- sscanf(ptr+1, "%1X", &value2) != 1) {
+ if (sscanf(ptr, "%1X", &value1) != 1
+ || sscanf(ptr+1, "%1X", &value2) != 1
+ ) {
if (!flag_plus_to_space)
return NULL;
*string++ = '%';
diff --git a/networking/wget.c b/networking/wget.c
index 49ebda7..028e18c 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -139,7 +139,7 @@ int wget_main(int argc, char **argv)
{ "passive-ftp", no_argument, NULL, 0xff },
{ "header", required_argument, NULL, 0xfe },
{ 0, 0, 0, 0 }
-};
+ };
applet_long_options = wget_long_options;
#endif
opt_complementary = "-1" USE_FEATURE_WGET_LONG_OPTIONS(":\xfe::");