summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5e0171c)
Also, wrbuf_buf will return same buffer as previous call to wrbuf_cstr.
n->buf = 0;
n->size = 0;
n->pos = 0;
n->buf = 0;
n->size = 0;
n->pos = 0;
const char *wrbuf_cstr(WRBUF b)
{
const char *wrbuf_cstr(WRBUF b)
{
- if (b->pos == 0)
- return "";
- assert(b->pos <= b->size);
+ assert(b && b->pos <= b->size);
b->buf[b->pos] = '\0';
return b->buf;
}
b->buf[b->pos] = '\0';
return b->buf;
}