diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2017-08-14 17:23:05 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2017-08-14 17:24:11 +0200 |
commit | e78605556770c19c7a2e52fbc67c1a89718ba9de (patch) | |
tree | 241d13319fd56822c3286e793e5721c4f8f4ee5b | |
parent | 7cca0da1cc58bd589989684147ae3a0cd5819902 (diff) |
osmux: Slightly improve output format of osmux_snprintf
The buffer for osmux_test is increased as the former doesn't seem to be
able to cope with the whole output.
Change-Id: Ic838dd9d7ad89b4510ccfa58c0390c69a075b616
-rw-r--r-- | src/osmux.c | 5 | ||||
-rw-r--r-- | tests/osmux/osmux_test.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/osmux.c b/src/osmux.c index 2481d6a..b3c43e2 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -877,12 +877,15 @@ static int osmux_snprintf_payload(char *buf, size_t size, int ret, i; int len = size, offset = 0; + ret = snprintf(buf+offset, len, "[ "); + SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + for (i=0; i<payload_len; i++) { ret = snprintf(buf+offset, len, "%02x ", payload[i]); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); } - ret = snprintf(buf+offset, len, "]"); + ret = snprintf(buf+offset, len, "] "); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); return offset; diff --git a/tests/osmux/osmux_test.c b/tests/osmux/osmux_test.c index 63f89f1..bf6174b 100644 --- a/tests/osmux/osmux_test.c +++ b/tests/osmux/osmux_test.c @@ -102,7 +102,7 @@ static struct osmux_out_handle h_output; static void osmux_deliver(struct msgb *batch_msg, void *data) { - char buf[1024]; + char buf[2048]; struct osmux_hdr *osmuxh; LLIST_HEAD(list); |