]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix 2 errors found by PVS studio
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Mon, 15 May 2017 21:00:16 +0000 (21:00 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Mon, 15 May 2017 21:00:16 +0000 (21:00 +0000)
(see  https://www.viva64.com/en/b/0504/ and bug 379502)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16379

coregrind/m_gdbserver/server.c
lackey/lk_main.c

index 2f26178e728b9a6ac258d8254d93d37a7f047843..1f3d13dfdebc4c731f34d0272b7c5a835b46a013 100644 (file)
@@ -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));
    }
 }
 
index 12b0034eb41f1b2ee88f3f0225f93d5ff7af1619..707ba972276d16c666c0cf34341ecfffad4c466d 100644 (file)
@@ -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");