diff options
Diffstat (limited to 'source4/heimdal/lib/roken/hex.c')
-rw-r--r-- | source4/heimdal/lib/roken/hex.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/heimdal/lib/roken/hex.c b/source4/heimdal/lib/roken/hex.c index 2daf247e90..2167172f9f 100644 --- a/source4/heimdal/lib/roken/hex.c +++ b/source4/heimdal/lib/roken/hex.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2005 Kungliga Tekniska Högskolan + * Copyright (c) 2004-2005 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -41,7 +41,7 @@ RCSID("$Id$"); const static char hexchar[] = "0123456789ABCDEF"; -static int +static int pos(char c) { const char *p; @@ -66,7 +66,7 @@ hex_encode(const void *data, size_t size, char **str) p = malloc(size * 2 + 1); if (p == NULL) return -1; - + for (i = 0; i < size; i++) { p[i * 2] = hexchar[(*q >> 4) & 0xf]; p[i * 2 + 1] = hexchar[*q & 0xf]; @@ -86,7 +86,7 @@ hex_decode(const char *str, void *data, size_t len) size_t i; l = strlen(str); - + /* check for overflow, same as (l+1)/2 but overflow safe */ if ((l/2) + (l&1) > len) return -1; |