aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-04-16 14:02:41 -0600
committerArnold D. Robbins <arnold@skeeve.com>2015-04-16 14:02:41 -0600
commit572f92d57d0d86f513127228653883d8b4b8b2c5 (patch)
tree9101c397cfde69304c8eea4d401fd8934d718aef /builtin.c
parent58dc708e3faa4aa46f81578a9a0ace4f0f7cad69 (diff)
parent8e68ee6137fa05f712b9402b4687f76f6aef85cd (diff)
downloadegawk-572f92d57d0d86f513127228653883d8b4b8b2c5.tar.gz
egawk-572f92d57d0d86f513127228653883d8b4b8b2c5.tar.bz2
egawk-572f92d57d0d86f513127228653883d8b4b8b2c5.zip
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/builtin.c b/builtin.c
index 500b35d9..6bd97e56 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1925,15 +1925,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);
}