Re: AW: AW: AW: [xml] xmlTextWriter



On Sat, Oct 11, 2003 at 05:29:11PM +1000, Malcolm Tredinnick wrote:
On Wed, 2003-10-08 at 20:37, Daniel Veillard wrote:
  yes, that's called a broken infrastructure... get a real vsnprintf,

That's a little harsh. :-)

  okay :-)

The return value of vsnprintf was changed in
C99 (compared to C89). It's something that really needs to be checked in
configure.in (basically it could return the current glibc number, the
current Microsoft number or -1, like older glibc's did -- although I'm
not sure what standard the latter behaviour was following).

The vsnprintf and snprintf functions are really ugly to work with
portably, since you really want to be able to assume a C99-compatible
compiler, but that is often unrealistic.

  it might be simpler to simply ignore the return value for length 
computation and simply walk the string from the copy point up to the
end (0 or len reached). Anyway snprintf is really expensive as a function
it should be avoided as much as possible, the cost of the string scan
is probably neglectible compared to the function itself for small to
medium strings.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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