Pau Espin Pedrol has submitted this change and it was merged.

Change subject: osmux: Slightly improve output format of osmux_snprintf
......................................................................


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
---
M src/osmux.c
M tests/osmux/osmux_test.c
2 files changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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 @@
        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 void osmux_deliver(struct msgb *batch_msg, void *data)
 {
-       char buf[1024];
+       char buf[2048];
        struct osmux_hdr *osmuxh;
        LLIST_HEAD(list);
 

-- 
To view, visit https://gerrit.osmocom.org/3522
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic838dd9d7ad89b4510ccfa58c0390c69a075b616
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <[email protected]>

Reply via email to