|
|
a3e2b5 |
From 4c6c21669483a38cf2a387784a3881b3a47139a3 Mon Sep 17 00:00:00 2001
|
|
|
a3e2b5 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
|
a3e2b5 |
Date: Sat, 7 Jul 2018 19:08:52 +0200
|
|
|
a3e2b5 |
Subject: [PATCH] test-bus-marshal: use cescaping instead of hexmem
|
|
|
a3e2b5 |
|
|
|
a3e2b5 |
It is easier to see the contents this way by eye.
|
|
|
a3e2b5 |
|
|
|
a3e2b5 |
(cherry picked from commit 3ddf3d439463ab2c76391a4d22b54166be2dbe94)
|
|
|
a3e2b5 |
|
|
|
a3e2b5 |
Resolves: #1696224
|
|
|
a3e2b5 |
---
|
|
|
a3e2b5 |
src/libsystemd/sd-bus/test-bus-marshal.c | 8 +++-----
|
|
|
a3e2b5 |
1 file changed, 3 insertions(+), 5 deletions(-)
|
|
|
a3e2b5 |
|
|
|
a3e2b5 |
diff --git a/src/libsystemd/sd-bus/test-bus-marshal.c b/src/libsystemd/sd-bus/test-bus-marshal.c
|
|
|
a3e2b5 |
index c647f0ff12..f007168ca6 100644
|
|
|
a3e2b5 |
--- a/src/libsystemd/sd-bus/test-bus-marshal.c
|
|
|
a3e2b5 |
+++ b/src/libsystemd/sd-bus/test-bus-marshal.c
|
|
|
a3e2b5 |
@@ -20,8 +20,8 @@
|
|
|
a3e2b5 |
#include "bus-label.h"
|
|
|
a3e2b5 |
#include "bus-message.h"
|
|
|
a3e2b5 |
#include "bus-util.h"
|
|
|
a3e2b5 |
+#include "escape.h"
|
|
|
a3e2b5 |
#include "fd-util.h"
|
|
|
a3e2b5 |
-#include "hexdecoct.h"
|
|
|
a3e2b5 |
#include "log.h"
|
|
|
a3e2b5 |
#include "util.h"
|
|
|
a3e2b5 |
|
|
|
a3e2b5 |
@@ -112,7 +112,7 @@ int main(int argc, char *argv[]) {
|
|
|
a3e2b5 |
uint8_t u, v;
|
|
|
a3e2b5 |
void *buffer = NULL;
|
|
|
a3e2b5 |
size_t sz;
|
|
|
a3e2b5 |
- char *h;
|
|
|
a3e2b5 |
+ _cleanup_free_ char *h = NULL;
|
|
|
a3e2b5 |
const int32_t integer_array[] = { -1, -2, 0, 1, 2 }, *return_array;
|
|
|
a3e2b5 |
char *s;
|
|
|
a3e2b5 |
_cleanup_free_ char *first = NULL, *second = NULL, *third = NULL;
|
|
|
a3e2b5 |
@@ -194,11 +194,9 @@ int main(int argc, char *argv[]) {
|
|
|
a3e2b5 |
r = bus_message_get_blob(m, &buffer, &sz);
|
|
|
a3e2b5 |
assert_se(r >= 0);
|
|
|
a3e2b5 |
|
|
|
a3e2b5 |
- h = hexmem(buffer, sz);
|
|
|
a3e2b5 |
+ h = cescape_length(buffer, sz);
|
|
|
a3e2b5 |
assert_se(h);
|
|
|
a3e2b5 |
-
|
|
|
a3e2b5 |
log_info("message size = %zu, contents =\n%s", sz, h);
|
|
|
a3e2b5 |
- free(h);
|
|
|
a3e2b5 |
|
|
|
a3e2b5 |
#if HAVE_GLIB
|
|
|
a3e2b5 |
#ifndef __SANITIZE_ADDRESS__
|