From: Jarkko Hietaniemi Date: Sat, 8 Apr 2006 18:55:41 +0000 (+0300) Subject: pp_sys.c: some Coverity findings: NULL guards for format cv X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0e528f24e7b99cb9698e649a1be36ce5daf462d9;p=p5sagit%2Fp5-mst-13.2.git pp_sys.c: some Coverity findings: NULL guards for format cv Message-Id: <20060408155541.46B796D08C@ugli.hut.fi> Date: Sat, 8 Apr 2006 18:55:41 +0300 (EEST) p4raw-id: //depot/perl@27756 --- diff --git a/pp_sys.c b/pp_sys.c index 1db57b0..c8a4638 100644 --- 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: diff --git a/t/op/write.t b/t/op/write.t index 3dd5023..5ac4a25 100755 --- a/t/op/write.t +++ b/t/op/write.t @@ -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; }