[
Lists Home |
Date Index |
Thread Index
]
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
|