MCPcopy Create free account
hub / github.com/apache/httpd / x2c

Function x2c

server/util.c:1845–1866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1843}
1844
1845static char x2c(const char *what)
1846{
1847 char digit;
1848
1849#if !APR_CHARSET_EBCDIC
1850 digit = ((what[0] >= 'A') ? ((what[0] & 0xdf) - 'A') + 10
1851 : (what[0] - '0'));
1852 digit *= 16;
1853 digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A') + 10
1854 : (what[1] - '0'));
1855#else /*APR_CHARSET_EBCDIC*/
1856 char xstr[5];
1857 xstr[0]='0';
1858 xstr[1]='x';
1859 xstr[2]=what[0];
1860 xstr[3]=what[1];
1861 xstr[4]='\0';
1862 digit = apr_xlate_conv_byte(ap_hdrs_from_ascii,
1863 0xFF & strtol(xstr, NULL, 16));
1864#endif /*APR_CHARSET_EBCDIC*/
1865 return (digit);
1866}
1867
1868/*
1869 * Unescapes a URL, leaving reserved characters intact.

Callers 3

ap_normalize_pathFunction · 0.85
unescape_urlFunction · 0.85
ap_parse_form_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected