Re: [xml-dev] genx - string termination and bounding

From
David Tolpin <>
To
Date
2004-01-22T10:34:27Z
ID
<>
Thread
Re: [xml-dev] genx - string termination and bounding
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