| ... | @@ -27,11 +27,13 @@ Buf *buf_sprintf(const char *format, ...) | ... | @@ -27,11 +27,13 @@ Buf *buf_sprintf(const char *format, ...) |
| 27 | Buf *buf_vprintf(const char *format, va_list ap); | 27 | Buf *buf_vprintf(const char *format, va_list ap); |
| 28 | | 28 | |
| 29 | static inline size_t buf_len(Buf *buf) { | 29 | static inline size_t buf_len(Buf *buf) { |
| | 30 | assert(buf); |
| 30 | assert(buf->list.length); | 31 | assert(buf->list.length); |
| 31 | return buf->list.length - 1; | 32 | return buf->list.length - 1; |
| 32 | } | 33 | } |
| 33 | | 34 | |
| 34 | static inline char *buf_ptr(Buf *buf) { | 35 | static inline char *buf_ptr(Buf *buf) { |
| | 36 | assert(buf); |
| 35 | assert(buf->list.length); | 37 | assert(buf->list.length); |
| 36 | return buf->list.items; | 38 | return buf->list.items; |
| 37 | } | 39 | } |