summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/roken/hex.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-10-27 11:35:07 +0100
committerStefan Metzmacher <metze@samba.org>2008-10-28 08:53:09 +0100
commit2b29b7186459d945ec448694164bfe4239b30d72 (patch)
tree561495b1870facf03f7892559a184f4f49df1fe2 /source4/heimdal/lib/roken/hex.c
parent698b7fd43658d9e96d28f26c9e1dae5e770bb57f (diff)
downloadsamba-2b29b7186459d945ec448694164bfe4239b30d72.tar.gz
samba-2b29b7186459d945ec448694164bfe4239b30d72.tar.bz2
samba-2b29b7186459d945ec448694164bfe4239b30d72.zip
s4: import lorikeet-heimdal-200810271034
metze
Diffstat (limited to 'source4/heimdal/lib/roken/hex.c')
-rw-r--r--source4/heimdal/lib/roken/hex.c8
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;