summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
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;