From 2c8f83106245df5d4115a0b065c61b4f76ed7774 Mon Sep 17 00:00:00 2001 From: ray Date: Sat, 31 Jul 2010 08:54:42 +0000 Subject: [PATCH] Checking for -1 as an overflow value is pretty absurd. Returning the unix epoch is equally absurd. Just return Start for now. We may add overflow checks in the future. OK xsa nicm --- usr.bin/cvs/date.y | 7 ++----- usr.bin/rcs/date.y | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/usr.bin/cvs/date.y b/usr.bin/cvs/date.y index 3421ebda471..eed407e10fd 100644 --- a/usr.bin/cvs/date.y +++ b/usr.bin/cvs/date.y @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: date.y,v 1.21 2010/07/29 18:52:45 ray Exp $ */ +/* $OpenBSD: date.y,v 1.22 2010/07/31 08:54:42 ray Exp $ */ /* ** Originally written by Steven M. Bellovin while @@ -862,10 +862,7 @@ date_parse(const char *p) Start += tod; } - /* Have to do *something* with a legitimate -1 so it's distinguishable - * from the error return value. (Alternately could set errno on error.) - */ - return (Start == -1) ? (0) : (Start); + return Start; } #if defined(TEST) diff --git a/usr.bin/rcs/date.y b/usr.bin/rcs/date.y index 6eca12eaacc..42984602e2d 100644 --- a/usr.bin/rcs/date.y +++ b/usr.bin/rcs/date.y @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: date.y,v 1.9 2010/07/29 18:52:45 ray Exp $ */ +/* $OpenBSD: date.y,v 1.10 2010/07/31 08:54:42 ray Exp $ */ /* ** Originally written by Steven M. Bellovin while @@ -867,10 +867,7 @@ date_parse(const char *p) Start += tod; } - /* Have to do *something* with a legitimate -1 so it's distinguishable - * from the error return value. (Alternately could set errno on error.) - */ - return (Start == -1) ? (0) : (Start); + return Start; } #if defined(TEST) -- 2.20.1