summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-06-19 08:03:53 -0500
committerDenis Kenzior <denkenz@gmail.com>2009-06-19 21:12:16 -0500
commit5068e895cb9a6310b8e58d5c2862f646a97b88af (patch)
treea40ca5ef9927669a51d144eb21b4ee7e123261a5 /src/util.c
parentfe486efadd33a15dd02fb37e0764f1f3535208bb (diff)
downloadofono-5068e895cb9a6310b8e58d5c2862f646a97b88af.tar.gz
Don't fail in own_buf if items_written is NULL
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c5
1 files 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;
}