pp_sys.c: some Coverity findings: NULL guards for format cv
Jarkko Hietaniemi [Sat, 8 Apr 2006 18:55:41 +0000 (21:55 +0300)]
Message-Id: <20060408155541.46B796D08C@ugli.hut.fi>
Date: Sat,  8 Apr 2006 18:55:41 +0300 (EEST)

p4raw-id: //depot/perl@27756

pp_sys.c
t/op/write.t

index 1db57b0..c8a4638 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1374,15 +1374,13 @@ PP(pp_leavewrite)
            gv_efullname4(sv, fgv, NULL, FALSE);
            name = SvPV_nolen_const(sv);
            if (name && *name)
-               DIE(aTHX_ "Undefined top format \"%s\" called",name);
+               DIE(aTHX_ "Undefined top format \"%s\" called", name);
+           else
+               DIE(aTHX_ "Undefined top format called");
        }
-       /* why no:
-       else
-           DIE(aTHX_ "Undefined top format called");
-       ?*/
-       if (CvCLONE(cv))
+       if (cv && CvCLONE(cv))
            cv = (CV*)sv_2mortal((SV*)cv_clone(cv));
-       return doform(cv,gv,PL_op);
+       return doform(cv, gv, PL_op);
     }
 
   forget_top:
index 3dd5023..5ac4a25 100755 (executable)
@@ -597,7 +597,7 @@ if ($opened) {
        }
     }
     close FROM_CHILD;
-    print + (@data?"not ":""), "ok ", $test++, " - too litle output\n";
+    print + (@data?"not ":""), "ok ", $test++, " - too little output\n";
     exit;
 }