Skip to content

Instantly share code, notes, and snippets.

@kaworu
Created May 30, 2017 16:54
Show Gist options
  • Save kaworu/e066f1c8f2f00aadc3e6ac48ff937ea9 to your computer and use it in GitHub Desktop.
Save kaworu/e066f1c8f2f00aadc3e6ac48ff937ea9 to your computer and use it in GitHub Desktop.
small patch to dbgutil.c so that Payload is printed in hex
diff --git a/tests/dbgutil.c b/tests/dbgutil.c
index 1335f93..b12fc19 100644
--- a/tests/dbgutil.c
+++ b/tests/dbgutil.c
@@ -45,7 +45,10 @@ void dump_data(const struct quirc_data *data)
printf(" Data type: %d (%s)\n",
data->data_type, data_type_str(data->data_type));
printf(" Length: %d\n", data->payload_len);
- printf(" Payload: %s\n", data->payload);
+ printf(" Payload: ");
+ for (int i = 0; i < data->payload_len; i++)
+ printf("%0x ", data->payload[i]);
+ printf("\n");
if (data->eci)
printf(" ECI: %d\n", data->eci);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment