From: Philippe Waroquiers Date: Mon, 15 May 2017 21:00:16 +0000 (+0000) Subject: Fix 2 errors found by PVS studio X-Git-Tag: svn/VALGRIND_3_13_0~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54e6c1e1fd5332c8e4cb8693b222e0b65ea423f7;p=thirdparty%2Fvalgrind.git Fix 2 errors found by PVS studio (see https://www.viva64.com/en/b/0504/ and bug 379502) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16379 --- diff --git a/coregrind/m_gdbserver/server.c b/coregrind/m_gdbserver/server.c index 2f26178e72..1f3d13dfde 100644 --- a/coregrind/m_gdbserver/server.c +++ b/coregrind/m_gdbserver/server.c @@ -107,7 +107,7 @@ void reset_valgrind_sink(const char *info) && initial_valgrind_sink_saved) { VG_(log_output_sink).fd = initial_valgrind_sink.fd; VG_(umsg) ("Reset valgrind output to log (%s)\n", - (info = NULL ? "" : info)); + (info == NULL ? "" : info)); } } diff --git a/lackey/lk_main.c b/lackey/lk_main.c index 12b0034eb4..707ba97227 100644 --- a/lackey/lk_main.c +++ b/lackey/lk_main.c @@ -1011,7 +1011,7 @@ static void lk_fini(Int exitcode) VG_(umsg)("Jccs:\n"); VG_(umsg)(" total: %'llu\n", total_Jccs); VG_(umsg)(" taken: %'llu (%.0f%%)\n", - taken_Jccs, taken_Jccs * 100.0 / total_Jccs ?: 1); + taken_Jccs, taken_Jccs * 100.0 / (total_Jccs ? total_Jccs : 1)); VG_(umsg)("\n"); VG_(umsg)("Executed:\n");