diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-04-26 22:39:23 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-04-26 22:39:23 +0300 |
commit | 043cc39d1352ab67d5b5de3b2991bd422e6c44b3 (patch) | |
tree | c1d162c244bef431aa35eedd6b151f2bf472b640 /builtin.c | |
parent | 56073f0c0343be08ea16b1ea6b34715eacc89a05 (diff) | |
parent | 1770ada8bd6e72dfd3138d72cd6049edca79a4f5 (diff) | |
download | egawk-043cc39d1352ab67d5b5de3b2991bd422e6c44b3.tar.gz egawk-043cc39d1352ab67d5b5de3b2991bd422e6c44b3.tar.bz2 egawk-043cc39d1352ab67d5b5de3b2991bd422e6c44b3.zip |
Merge branch 'master' into feature/shadow-builtins
Diffstat (limited to 'builtin.c')
-rw-r--r-- | builtin.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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); } |