Discussion:
[OpenOCD-devel] [PATCH]: fd1f21d target: Fix snprintf format string and argument mismatch in md output
gerrit
2017-06-22 12:24:46 UTC
Permalink
This is an automated email from Gerrit.

Andreas Fritiofson (***@gmail.com) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/4167

-- gerrit

commit fd1f21df3d889d3e9f35584303a647ee75860386
Author: Andreas Fritiofson <***@gmail.com>
Date: Thu Jun 22 14:23:58 2017 +0200

target: Fix snprintf format string and argument mismatch in md output

Commit 47b8cf842 changed the fixed type of the value argument to snprint
but didn't change the format string to match for sizes != 64 bit.

Change-Id: I908b06f49ab69d04224282949190a0de883048e0
Signed-off-by: Andreas Fritiofson <***@gmail.com>

diff --git a/src/target/target.c b/src/target/target.c
index e04ecc4..8f97666 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -3024,16 +3024,16 @@ static void handle_md_output(struct command_context *cmd_ctx,
const char *value_fmt;
switch (size) {
case 8:
- value_fmt = "%16.16llx ";
+ value_fmt = "%16.16"PRIx64" ";
break;
case 4:
- value_fmt = "%8.8x ";
+ value_fmt = "%8.8"PRIx64" ";
break;
case 2:
- value_fmt = "%4.4x ";
+ value_fmt = "%4.4"PRIx64" ";
break;
case 1:
- value_fmt = "%2.2x ";
+ value_fmt = "%2.2"PRIx64" ";
break;
default:
/* "can't happen", caller checked */

--

Loading...