[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-664
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-664-g2e7a100 |
Date: |
Thu, 16 Apr 2015 19:59:45 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, gawk-4.1-stable has been updated
via 2e7a100d802bd835f61b03544343267d2cfc5f4f (commit)
from e934ad609d3639152324a4211857d87f228cf938 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=2e7a100d802bd835f61b03544343267d2cfc5f4f
commit 2e7a100d802bd835f61b03544343267d2cfc5f4f
Author: Arnold D. Robbins <address@hidden>
Date: Thu Apr 16 22:59:17 2015 +0300
Return "" from strftime if bad time_t value instead of fatal.
diff --git a/ChangeLog b/ChangeLog
index 0fa04f6..14f4af1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-04-16 Arnold D. Robbins <address@hidden>
+
+ * builtin.c (do_strftime): For bad time_t values, return "".
+
2015-04-16 Andrew J. Schorr <address@hidden>
* node.c (r_force_number): If strtod sets errno, then force the
diff --git a/builtin.c b/builtin.c
index 804bd60..a62437a 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1917,15 +1917,21 @@ do_strftime(int nargs)
clock_val = get_number_d(t2);
fclock = (time_t) clock_val;
/*
- * 4/2015: Protect against negative value being assigned
+ * Protect against negative value being assigned
* to unsigned time_t.
*/
- if (clock_val < 0 && fclock > 0)
- fatal(_("strftime: second argument less than 0
or too big for time_t"));
+ if (clock_val < 0 && fclock > 0) {
+ if (do_lint)
+ lintwarn(_("strftime: second argument
less than 0 or too big for time_t"));
+ return make_string("", 0);
+ }
/* And check that the value is in range */
- if (clock_val < time_t_min || clock_val > time_t_max)
- fatal(_("strftime: second argument out of range
for time_t"));
+ if (clock_val < time_t_min || clock_val > time_t_max) {
+ if (do_lint)
+ lintwarn(_("strftime: second argument
out of range for time_t"));
+ return make_string("", 0);
+ }
DEREF(t2);
}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 ++++
builtin.c | 16 +++++++++++-----
2 files changed, 15 insertions(+), 5 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-664-g2e7a100,
Arnold Robbins <=