From: Michael G Schwern Date: Sun, 14 Sep 2008 21:57:07 +0000 (-0700) Subject: Fix the overflow warning to just check for an error. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5b6366c2b24f4ede69b7d904d8bceeac450b21bf;p=p5sagit%2Fp5-mst-13.2.git Fix the overflow warning to just check for an error. Fix the overflow warning to identify the right op. --- diff --git a/pp_sys.c b/pp_sys.c index 1e445da..ad39804 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -4470,9 +4470,11 @@ PP(pp_gmtime) else err = gmtime64_r(&when, &tmbuf); - if( (tmbuf.tm_year + 1900) < 0 ) + if( err == NULL ) { + char *opname = PL_op->op_type == OP_LOCALTIME ? "localtime" : "gmtime"; Perl_warner(aTHX_ packWARN(WARN_OVERFLOW), - "local/gmtime under/overflowed the year"); + "%s under/overflowed the year", opname); + } if (GIMME != G_ARRAY) { /* scalar context */ SV *tsv;