From 9f1b45b0da430a7a7abf9e54acbe6f2ef9d3a763 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 18 Jan 2014 14:42:54 -0700 Subject: don't let bin2hex call strlen Currently bin2hex may call strlen if the length argument is zero. This prevents some function unification; and also it seems cleaner to me not to have a special meaning for a zero length. 2014-02-12 Tom Tromey * common/rsp-low.c (bin2hex): Never take strlen of argument. * remote.c (extended_remote_run, remote_rcmd) (remote_download_trace_state_variable, remote_save_trace_data) (remote_set_trace_notes): Update. * tracepoint.c (encode_source_string, tfile_write_status) (tfile_write_uploaded_tsv): Update. --- gdb/common/rsp-low.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'gdb/common') diff --git a/gdb/common/rsp-low.c b/gdb/common/rsp-low.c index 07e7ddb..7f0445c 100644 --- a/gdb/common/rsp-low.c +++ b/gdb/common/rsp-low.c @@ -163,10 +163,6 @@ bin2hex (const gdb_byte *bin, char *hex, int count) { int i; - /* May use a length, or a nul-terminated string as input. */ - if (count == 0) - count = strlen ((char *) bin); - for (i = 0; i < count; i++) { *hex++ = tohex ((*bin >> 4) & 0xf); -- cgit v1.1