Re: [xml] Return value of xmlCharEncodingInputFunc
- From: Stefan Behnel <stefan_ml behnel de>
- To: Ralf Junker <ralfjunker gmx de>
- Cc: xml gnome org
- Subject: Re: [xml] Return value of xmlCharEncodingInputFunc
- Date: Fri, 01 Feb 2008 16:33:38 +0100
Hi,
Ralf Junker wrote:
I am in doubt about the -1 return value of these function prototypes:
* xmlCharEncodingInputFunc
* xmlCharEncodingOutputFunc
The documentation says that -1 means "lack of space". However, in various implementations of these function
prototype I see this:
if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
So I wonder if the -1 result value means
1. lack of space in the output buffer
2. illegal arguments passed
The difference is that with 1 I would need to provide more output, but with 2. I would issue a parameter
error.
Does anyone which one of the two (or yet another) is the corret understanding of -1?
I think that's easy: you control what goes in and out, so the NULL checks will
not apply to you. All that can really go wrong is malloc problems. So the docs
are (mainly) correct.
Stefan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]