From 5068e895cb9a6310b8e58d5c2862f646a97b88af Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 19 Jun 2009 08:03:53 -0500 Subject: [PATCH] Don't fail in own_buf if items_written is NULL --- src/util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util.c b/src/util.c index de509c70..84ce5075 100644 --- a/src/util.c +++ b/src/util.c @@ -596,7 +596,7 @@ unsigned char *pack_7bit_own_buf(const unsigned char *in, long len, long i; long total_bits; - if (len == 0 || !items_written) + if (len == 0) return NULL; if (len < 0) { @@ -651,7 +651,8 @@ unsigned char *pack_7bit_own_buf(const unsigned char *in, long len, out++; } - *items_written = out - buf; + if (items_written) + *items_written = out - buf; return buf; }