8f323ca
diff --git a/analyzer/pnmpsnr.c b/analyzer/pnmpsnr.c
8f323ca
index ce2708b..b04316c 100644
8f323ca
--- a/analyzer/pnmpsnr.c
8f323ca
+++ b/analyzer/pnmpsnr.c
8f323ca
@@ -55,14 +55,14 @@ validateInput(struct pam const pam1,
8f323ca
                  "maxval of one of them.",
8f323ca
                  (unsigned int) pam1.maxval, (unsigned int) pam2.maxval);
8f323ca
 
8f323ca
-    if (streq(pam1.tuple_type, pam2.tuple_type))
8f323ca
+    if (!streq(pam1.tuple_type, pam2.tuple_type))
8f323ca
         pm_error("images are not of the same type.  The tuple types are "
8f323ca
                  "'%s' and '%s', respectively.",
8f323ca
                  pam1.tuple_type, pam2.tuple_type);
8f323ca
 
8f323ca
-    if (streq(pam1.tuple_type, PAM_PBM_TUPLETYPE) &&
8f323ca
-        streq(pam1.tuple_type, PAM_PGM_TUPLETYPE) &&
8f323ca
-        streq(pam1.tuple_type, PAM_PPM_TUPLETYPE))
8f323ca
+    if (!streq(pam1.tuple_type, PAM_PBM_TUPLETYPE) &&
8f323ca
+        !streq(pam1.tuple_type, PAM_PGM_TUPLETYPE) &&
8f323ca
+        !streq(pam1.tuple_type, PAM_PPM_TUPLETYPE))
8f323ca
         pm_error("Images are not of a PNM type.  Tuple type is '%s'",
8f323ca
                  pam1.tuple_type);
8f323ca
 }