martin 98/03/25 07:17:07
Modified: src/modules/proxy proxy_util.c Log: Add ASCII<-->EBCDIC conversion to hex conversion routines Revision Changes Path 1.54 +4 -3 apache-1.3/src/modules/proxy/proxy_util.c Index: proxy_util.c =================================================================== RCS file: /home/cvs/apache-1.3/src/modules/proxy/proxy_util.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -u -r1.53 -r1.54 --- proxy_util.c 1998/03/25 15:12:05 1.53 +++ proxy_util.c 1998/03/25 15:17:06 1.54 @@ -89,7 +89,7 @@ i += ch - ('a' - 10); return i; #else /*CHARSET_EBCDIC*/ - return (1 == sscanf(x, "%2x", &i)) ? i : 0; + return (1 == sscanf(x, "%2x", &i)) ? os_toebcdic[i&0xFF] : 0; #endif /*CHARSET_EBCDIC*/ } @@ -112,9 +112,10 @@ x[2] = '0' + i; #else /*CHARSET_EBCDIC*/ static const char ntoa[] = { "0123456789ABCDEF" }; + ch &= 0xFF; x[0] = '%'; - x[1] = ntoa[(ch>>4)&0x0F]; - x[2] = ntoa[ch&0x0F]; + x[1] = ntoa[(os_toascii[ch]>>4)&0x0F]; + x[2] = ntoa[os_toascii[ch]&0x0F]; x[3] = '\0'; #endif /*CHARSET_EBCDIC*/ }