Discussion:
Valgrind: r16379 - in /trunk: coregrind/m_gdbserver/server.c lackey/lk_main.c
(too old to reply)
s***@valgrind.org
2017-05-15 21:00:16 UTC
Permalink
Raw Message
Author: philippe
Date: Mon May 15 22:00:16 2017
New Revision: 16379

Log:
Fix 2 errors found by PVS studio
(see https://www.viva64.com/en/b/0504/ and bug 379502)


Modified:
trunk/coregrind/m_gdbserver/server.c
trunk/lackey/lk_main.c

Modified: trunk/coregrind/m_gdbserver/server.c
==============================================================================
--- trunk/coregrind/m_gdbserver/server.c (original)
+++ trunk/coregrind/m_gdbserver/server.c Mon May 15 22:00:16 2017
@@ -107,7 +107,7 @@
&& 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));
}
}


Modified: trunk/lackey/lk_main.c
==============================================================================
--- trunk/lackey/lk_main.c (original)
+++ trunk/lackey/lk_main.c Mon May 15 22:00:16 2017
@@ -1011,7 +1011,7 @@
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");

Loading...