diff --git a/configure.ac b/configure.ac
index 8465b4326278d17637221b335f3d8dd91e5b99f8..f8cad48b1716f1502f607caa580f0f2298873dfe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -812,7 +812,7 @@ if test "$have_clang" = "yes"; then
 	  int main(int argc, char **argv)
 	  {
             int64_t x = ((int64_t)atoi(argv[1])) * (int64_t)atoi(argv[2])
-	                * (int64_t)argv[3];
+	                * (int64_t)atoi(argv[3]);
 	    return x == 9;
 	  } ]])],
 	  [ftrapv_can_link=yes; AC_MSG_RESULT([yes])],
@@ -831,7 +831,7 @@ if test "$have_clang" = "yes"; then
 	  int main(int argc, char **argv)
 	  {
             int64_t x = ((int64_t)atoi(argv[1])) * (int64_t)atoi(argv[2])
-	                * (int64_t)argv[3];
+	                * (int64_t)atoi(argv[3]);
 	    return x == 9;
 	  } ]])],
 	  [mulodi_fixes_ftrapv=yes; AC_MSG_RESULT([yes])],