diff options
author | Andy Shevchenko <andy.shevchenko@gmail.com> | 2010-09-21 02:40:25 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-09-21 22:45:07 -0400 |
commit | e7f483eabea8ef6d2b5ce1b74c8184cc06819f15 (patch) | |
tree | 5c3e397ed7e31886d39e1140bb6aa278e138f36f /net | |
parent | 1117449276bb909b029ed0b9ba13f53e4784db9d (diff) |
sunrpc/cache: don't use custom hex_to_bin() converter
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/cache.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 2a8405194056..ac2c6e6abe65 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c | |||
@@ -1179,13 +1179,19 @@ int qword_get(char **bpp, char *dest, int bufsize) | |||
1179 | if (bp[0] == '\\' && bp[1] == 'x') { | 1179 | if (bp[0] == '\\' && bp[1] == 'x') { |
1180 | /* HEX STRING */ | 1180 | /* HEX STRING */ |
1181 | bp += 2; | 1181 | bp += 2; |
1182 | while (isxdigit(bp[0]) && isxdigit(bp[1]) && len < bufsize) { | 1182 | while (len < bufsize) { |
1183 | int byte = isdigit(*bp) ? *bp-'0' : toupper(*bp)-'A'+10; | 1183 | int h, l; |
1184 | bp++; | 1184 | |
1185 | byte <<= 4; | 1185 | h = hex_to_bin(bp[0]); |
1186 | byte |= isdigit(*bp) ? *bp-'0' : toupper(*bp)-'A'+10; | 1186 | if (h < 0) |
1187 | *dest++ = byte; | 1187 | break; |
1188 | bp++; | 1188 | |
1189 | l = hex_to_bin(bp[1]); | ||
1190 | if (l < 0) | ||
1191 | break; | ||
1192 | |||
1193 | *dest++ = (h << 4) | l; | ||
1194 | bp += 2; | ||
1189 | len++; | 1195 | len++; |
1190 | } | 1196 | } |
1191 | } else { | 1197 | } else { |