From e044a7bcd1de3b7bd05de332165eedf3d875f675 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 23 Jan 2010 00:59:48 +0000 Subject: [PATCH] fix printf security warnings about passing a buffer instead of a const format string git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1696 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 3 +++ urjtag/src/tap/cable/jlink.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 43d09abe..34f43dc8 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -3,6 +3,9 @@ * src/cmd/cmd_bit.c (cmd_bit_print_params): Fix strncat length handling. * src/tap/detect.c (urj_tap_detect_parts): Likewise. + * src/tap/cable/jlink.c (jlink_debug_buffer): Unify log lines to avoid + printf format security warnings. + 2010-01-21 Jie Zhang * src/apps/jtag/jtag.c (main): Don't trigger open file error diff --git a/urjtag/src/tap/cable/jlink.c b/urjtag/src/tap/cable/jlink.c index fe4460b1..22ac6e73 100644 --- a/urjtag/src/tap/cable/jlink.c +++ b/urjtag/src/tap/cable/jlink.c @@ -404,8 +404,7 @@ jlink_debug_buffer (char *buffer, int length) snprintf (s, 4, " %02x", buffer[j]); strcat (line, s); } - urj_log (URJ_LOG_LEVEL_DETAIL, line); - urj_log (URJ_LOG_LEVEL_DETAIL, "\n"); + urj_log (URJ_LOG_LEVEL_DETAIL, "%s\n", line); } }