[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [xml] strchr in xmlschemas.c



On Mon, 5 Apr 2004 at 03:09 -0400 Daniel Veillard wrote:

>On Sun, Apr 04, 2004 at 05:40:45PM +0100, Philip Ludlam wrote:
>> Dear All,
>> 
>> My C implementation defines strchr to have 2 arguments, the 1st being
>> a char* .
>> 
>> As xmlChar is an unsigned char and not a char, my C compiler faults the
>> use of strchr at line 1495 in xmlschemas.c in libxml2-2.6.8
>> 
>> The attached patch calls xmlStrchr in it's place.
>
>  This was fixed by using
>    if (!strchr((char *) val, ':'))
>in CVS already,

Ah, I checked that yesterday - but I guess the change hadn't filtered through to the anoncvs server.

But I don't think that fix is wholly suitable - what if you or someone else changes the definition of xmlChar? Then casting an xmlChar * to a char * will inevitably cause problems further down the line.

Yours,

Phil L.
-- 
http://www.philipnet.com | http://director.sourceforge.net




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]