Re: [PATCH] - improved decoding of URL special characters

Andrew Sveikauskas <[email protected]> Wed, 19 Oct 2005 17:13:56 -0400
Newsgroups gmane.comp.multimedia.xmms.devel
Message-ID <[email protected]>
On Wed, Oct 19, 2005 at 04:53:30PM -0400, Roger Fujii wrote:
> much better, but you want to do this:
> 
> 			if( r[1] && (isxdigit(r[1]) && isxdigit(r[2])) )
> 
> instead (lessen possible segfaults with strings ending with a %)

I had already considered this.  isxdigit(0) returns 0.  So if r[1] is zero the
first part of the if statement fails.

I've also tested it with a string ending in %.  Appears to work fine on OpenBSD.
Maybe other platforms have a different behavior for isxdigit(0), I don't know.