aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-04-26 22:38:57 +0300
committerArnold D. Robbins <arnold@skeeve.com>2015-04-26 22:38:57 +0300
commit020be4cb81b519a597acbf85e683cfb95993c2b9 (patch)
treea6df5c20262e0d679a0a4ab17c83c484e9ba1fe6 /builtin.c
parent6f250fa2a01864e07c1e9022f36eab740a2793c5 (diff)
parent1770ada8bd6e72dfd3138d72cd6049edca79a4f5 (diff)
downloadegawk-020be4cb81b519a597acbf85e683cfb95993c2b9.tar.gz
egawk-020be4cb81b519a597acbf85e683cfb95993c2b9.tar.bz2
egawk-020be4cb81b519a597acbf85e683cfb95993c2b9.zip
Merge branch 'master' into feature/regex-type
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 d50e75ae..e10e8689 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);
}