authorgravatar for shawn@git.icuShawn Landden <shawn@git.icu> 2019-06-16 13:17:33-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-16 14:26:38-04:00
log4d3356435f453bdc24ac3c6c2da74d98c981db15
treee3d18f2e6097b669b30b5c4b5c97b3423b747247
parentf4b8850002d5f617450a9d08b05519f390bd3f21

stage1: check for null in buf_len and buf_ptr

follow up for f4b8850002d5

1 files changed, 2 insertions(+), 0 deletions(-)

src/buffer.hpp+2
......@@ -27,11 +27,13 @@ Buf *buf_sprintf(const char *format, ...)
2727Buf *buf_vprintf(const char *format, va_list ap);
2828
2929static inline size_t buf_len(Buf *buf) {
30 assert(buf);
3031 assert(buf->list.length);
3132 return buf->list.length - 1;
3233}
3334
3435static inline char *buf_ptr(Buf *buf) {
36 assert(buf);
3537 assert(buf->list.length);
3638 return buf->list.items;
3739}