diff options
author | stevel@tonic-gate <none@none> | 2005-06-14 00:00:00 -0700 |
---|---|---|
committer | stevel@tonic-gate <none@none> | 2005-06-14 00:00:00 -0700 |
commit | 7c478bd95313f5f23a4c958a745db2134aa03244 (patch) | |
tree | c871e58545497667cbb4b0a4f2daf204743e1fe7 /usr/src/lib/libldap5/sources/ldap/common/secutil.c | |
download | illumos-gate-7c478bd95313f5f23a4c958a745db2134aa03244.tar.gz |
OpenSolaris Launch
Diffstat (limited to 'usr/src/lib/libldap5/sources/ldap/common/secutil.c')
-rw-r--r-- | usr/src/lib/libldap5/sources/ldap/common/secutil.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/usr/src/lib/libldap5/sources/ldap/common/secutil.c b/usr/src/lib/libldap5/sources/ldap/common/secutil.c new file mode 100644 index 0000000000..7df5423e83 --- /dev/null +++ b/usr/src/lib/libldap5/sources/ldap/common/secutil.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2001 by Sun Microsystems, Inc. + * All rights reserved. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <stdlib.h> +#include <string.h> +#include <ctype.h> + +static char hexdig[] = "0123456789abcdef"; + +char* hexa_print(char *aString, int aLen) +{ + char *res; + int i =0; + + if ((res = (char *)calloc (aLen*2 + 1, 1 )) == NULL){ + return (NULL); + } + for (;;){ + if (aLen < 1) + break; + res[i] = hexdig[ ( *aString & 0xf0 ) >> 4 ]; + res[i + 1] = hexdig[ *aString & 0x0f ]; + i+= 2; + aLen--; + aString++; + } + return (res); +} |