diff options
author | Denys Vlasenko | 2010-04-04 15:29:32 +0200 |
---|---|---|
committer | Denys Vlasenko | 2010-04-04 15:29:32 +0200 |
commit | 4836331924b5eb7f74e000d50c99bc12d513f8c7 (patch) | |
tree | 96c25b9daf69ba688350874e9b51bfc6758237fe /networking/wget.c | |
parent | c03602baa483ed07230c88075121e0f56a4c0428 (diff) | |
download | busybox-4836331924b5eb7f74e000d50c99bc12d513f8c7.zip busybox-4836331924b5eb7f74e000d50c99bc12d513f8c7.tar.gz |
libbb: factor out hex2bin() for infiniband address parser
function old new delta
hex2bin - 149 +149
in_ib 172 27 -145
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/wget.c')
-rw-r--r-- | networking/wget.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/networking/wget.c b/networking/wget.c index 5b73b93..97f4a8f 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -282,8 +282,10 @@ static char *gethdr(char *buf, size_t bufsiz, FILE *fp /*, int *istrunc*/) return NULL; /* convert the header name to lower case */ - for (s = buf; isalnum(*s) || *s == '-' || *s == '.'; ++s) - *s = tolower(*s); + for (s = buf; isalnum(*s) || *s == '-' || *s == '.'; ++s) { + /* tolower for "A-Z", no-op for "0-9a-z-." */ + *s = (*s | 0x20); + } /* verify we are at the end of the header name */ if (*s != ':') |