Re: [xml] Some things about xmlCharEncodingHandler

oliverst online de said:
I also recognised, that in the function xmlFindCharEncodingHandler()
encoding.c the parameter "const char *name" is changed in the
The pointer will be set to the returning pointer of
xmlGetEncodingAlias(). IMO it should not be altered, because you
want to use that var in the calling function with the (maybe wrong)
name. And I guess it causes a little memory leak. After the
xmlGetEncodingAlias call the var "nalias" should be used and
set to name if the result was NULL.

So long

I think there may be a little confusion here (although I frequently
get confused in this area of C programming :).  I think that "const
char *name" means that the string pointed to by the variable 'name'
is constant; the variable itself is a stack variable "owned" by the
function, and changing it has no effect on the calling function.


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