8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / libldap5 / sources / ldap / common / secutil.c
blob7df5423e831732e18be68d026eefd0feb0617736
1 /*
2 * Copyright (c) 2001 by Sun Microsystems, Inc.
3 * All rights reserved.
4 */
6 #pragma ident "%Z%%M% %I% %E% SMI"
8 #include <stdlib.h>
9 #include <string.h>
10 #include <ctype.h>
12 static char hexdig[] = "0123456789abcdef";
14 char* hexa_print(char *aString, int aLen)
16 char *res;
17 int i =0;
19 if ((res = (char *)calloc (aLen*2 + 1, 1 )) == NULL){
20 return (NULL);
22 for (;;){
23 if (aLen < 1)
24 break;
25 res[i] = hexdig[ ( *aString & 0xf0 ) >> 4 ];
26 res[i + 1] = hexdig[ *aString & 0x0f ];
27 i+= 2;
28 aLen--;
29 aString++;
31 return (res);