From 601ae1378ba7bb59e9c1a19fcc4ddd7bf9fb2e1b Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 28 Nov 2006 23:37:46 +0000 Subject: od: sometime ago I landed BIG od implementation from coreutils. My fault. This commit contains cleanups and size reductions. --- networking/httpd.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'networking/httpd.c') diff --git a/networking/httpd.c b/networking/httpd.c index 0de60ba06..f95e0c06e 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++ = '%'; -- cgit v1.2.3