Split off Curl_isxdigit function
This commit is contained in:
parent
b9ce871463
commit
79fc481a2b
@ -81,6 +81,14 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Check for an ASCII hex digit.
|
||||||
|
We avoid the use of isxdigit to accommodate non-ASCII hosts. */
|
||||||
|
static bool Curl_isxdigit(char digit)
|
||||||
|
{
|
||||||
|
return (digit >= 0x30 && digit <= 0x39) /* 0-9 */
|
||||||
|
|| (digit >= 0x41 && digit <= 0x46) /* A-F */
|
||||||
|
|| (digit >= 0x61 && digit <= 0x66); /* a-f */
|
||||||
|
}
|
||||||
|
|
||||||
void Curl_httpchunk_init(struct connectdata *conn)
|
void Curl_httpchunk_init(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
@ -127,11 +135,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
|
|||||||
while(length) {
|
while(length) {
|
||||||
switch(ch->state) {
|
switch(ch->state) {
|
||||||
case CHUNK_HEX:
|
case CHUNK_HEX:
|
||||||
/* Check for an ASCII hex digit.
|
if(Curl_isxdigit(*datap)) {
|
||||||
We avoid the use of isxdigit to accommodate non-ASCII hosts. */
|
|
||||||
if((*datap >= 0x30 && *datap <= 0x39) /* 0-9 */
|
|
||||||
|| (*datap >= 0x41 && *datap <= 0x46) /* A-F */
|
|
||||||
|| (*datap >= 0x61 && *datap <= 0x66)) { /* a-f */
|
|
||||||
if(ch->hexindex < MAXNUM_SIZE) {
|
if(ch->hexindex < MAXNUM_SIZE) {
|
||||||
ch->hexbuffer[ch->hexindex] = *datap;
|
ch->hexbuffer[ch->hexindex] = *datap;
|
||||||
datap++;
|
datap++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user