[Home] [By Thread] [By Date] [Recent Entries]

  • To: xml-dev@l...
  • Subject: Re: genx - string termination and bounding
  • From: David Tolpin <dvd@d...>
  • Date: Thu, 22 Jan 2004 14:34:27 +0400 (AMT)

I don't like NULL as an argument because if I pass an uninitalized pointer 
happened to be NULL (and uninitialized pointer will be NULL in some flavours of C)
by omission, then instead of getting an error immediately, I see strange
behavior difficult to diagnose.

In fact, I would prefer asserts for non NULL in genxText

genxText(genxWriter *w, char *buf, char *end) {
  assert(buf!=NULL&&end>=buf);
  ...

genxTextZ(genxWriter *w,char *buf) {
  genxText(w,buf,buf+strlen(buf)); // it is fast, one will have to pass it with length anyway

David  

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member