/* agxbmore;
* Expand buffer to hold at least ssz more bytes.
*/
-int agxbmore(agxbuf * xb, size_t ssz)
+void agxbmore(agxbuf * xb, size_t ssz)
{
size_t cnt = 0; /* current no. of characters in buffer */
size_t size = 0; /* current buffer size */
xb->buf = nbuf;
xb->ptr = xb->buf + cnt;
xb->eptr = xb->buf + nsize;
- return 0;
}
int agxbprint(agxbuf * xb, const char *fmt, ...) {
size_t unused_space = (size_t)(xb->eptr - xb->ptr);
if (unused_space < size) {
size_t extra = size - unused_space;
- (void)agxbmore(xb, extra);
+ agxbmore(xb, extra);
}
}
/* agxbmore:
* Expand buffer to hold at least ssz more bytes.
*/
- AGXBUF_API int agxbmore(agxbuf * xb, size_t ssz);
+ AGXBUF_API void agxbmore(agxbuf * xb, size_t ssz);
/* agxbputc:
* Add character to buffer.
*/
static inline int agxbputc(agxbuf * xb, char c) {
if (xb->ptr >= xb->eptr) {
- if (agxbmore(xb, 1) != 0) {
- return -1;
- }
+ agxbmore(xb, 1);
}
*xb->ptr++ = (unsigned char)c;
return 0;