Re: Read hex string to a buf
- From: gazelle@xxxxxxxxxxxxxxxxxxxxx (Kenny McCormack)
- Date: Wed, 31 Jan 2007 08:34:01 +0000 (UTC)
In article <lnwt3338ks.fsf@xxxxxxxxxxxxxxx>,
Keith Thompson <kst-u@xxxxxxx> wrote:
Christopher Layne <clayne@xxxxxxxxxxxx> writes:
Keith Thompson wrote:[...]
const size_t minl = 2;
const size_t nibl = 4;
const char delim[2] = "0x";
const char set[2][16] = { "0123456789abcdef", "0123456789ABCDEF" };
You accept hexadecimal digits in either upper or lower case, but you
don't do the same for "0x" vs. "0X".
Sigh.
/* Make Keith Thompson Happy */
if (q[0] == '0' && (q[1] == 'x' || q[1] == 'X')) {
q += minl; l -= minl;
}
It doesn't make me either happy or unhappy.
There's a rumor floating around that KT was happy. Once.
Sometime back in the mid 60s. Nobody's sure what caused it.
Many don't believe it ever happened.
.
- References:
- Read hex string to a buf
- From: cppbeginner
- Re: Read hex string to a buf
- From: Keith Thompson
- Re: Read hex string to a buf
- From: Christopher Layne
- Re: Read hex string to a buf
- From: Keith Thompson
- Read hex string to a buf
- Prev by Date: Re: Initialising Variables
- Next by Date: Re: Read hex string to a buf
- Previous by thread: Re: Read hex string to a buf
- Next by thread: Re: Read hex string to a buf
- Index(es):
Relevant Pages
|