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

Roger Fujii <[email protected]> Wed, 19 Oct 2005 16:53:30 -0400
Newsgroups gmane.comp.multimedia.xmms.devel
Message-ID <[email protected]>
Andrew Sveikauskas wrote:

> My humble opinion is that a better urldecodestr()-type function would look
> like this.  Notably, let the libc do the hex conversion.  This also does
> less copies if the string consists of more than one %xx sequence.
> 
> But.  This is just my opinion.
> 

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 %)

-r