mirror of git://git.sysmocom.de/ofono
Don't fail in own_buf if items_written is NULL
This commit is contained in:
parent
fe486efadd
commit
5068e895cb
|
@ -596,7 +596,7 @@ unsigned char *pack_7bit_own_buf(const unsigned char *in, long len,
|
||||||
long i;
|
long i;
|
||||||
long total_bits;
|
long total_bits;
|
||||||
|
|
||||||
if (len == 0 || !items_written)
|
if (len == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
|
@ -651,7 +651,8 @@ unsigned char *pack_7bit_own_buf(const unsigned char *in, long len,
|
||||||
out++;
|
out++;
|
||||||
}
|
}
|
||||||
|
|
||||||
*items_written = out - buf;
|
if (items_written)
|
||||||
|
*items_written = out - buf;
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue