summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorMichael G Schwern <schwern@pobox.com>2008-09-14 14:57:07 -0700
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-01-03 18:37:12 +0100
commit5b6366c2b24f4ede69b7d904d8bceeac450b21bf (patch)
tree457407f3e83acdb7ba59d127ca4f3c7b59577802 /pp_sys.c
parent7bda3dfccb26dc3c52669a7451b220893a99a1be (diff)
downloadperl-5b6366c2b24f4ede69b7d904d8bceeac450b21bf.tar.gz
Fix the overflow warning to just check for an error.
Fix the overflow warning to identify the right op.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 1e445da087..ad39804000 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;