diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-07-13 13:59:03 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-07-13 13:59:03 +0300 |
commit | 52e6f76e7c0199cf5ae64e4b23698884cc245912 (patch) | |
tree | d0a2d6ad0334223e4c98bf197d94ba5dcbe95605 /node.c | |
parent | eeb3f87fbec2065a3df0fe09de02ac2279414f26 (diff) | |
parent | 8dba5f4c900239d01897e2197ddd79bcf5d9b034 (diff) | |
download | egawk-52e6f76e7c0199cf5ae64e4b23698884cc245912.tar.gz egawk-52e6f76e7c0199cf5ae64e4b23698884cc245912.tar.bz2 egawk-52e6f76e7c0199cf5ae64e4b23698884cc245912.zip |
Merge branch 'gawk-4.2-stable'
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -219,10 +219,13 @@ r_format_val(const char *format, int index, NODE *s) * < and > so that things work correctly on systems with 64 bit integers. */ - /* not an integral value, or out of range */ - if ((val = double_to_int(s->numbr)) != s->numbr + if (out_of_range(s)) { + const char *result = format_nan_inf(s, 'g'); + return make_string(result, strlen(result)); + } else if ((val = double_to_int(s->numbr)) != s->numbr || val <= LONG_MIN || val >= LONG_MAX ) { + /* not an integral value, or out of integer range */ /* * Once upon a time, we just blindly did this: * sprintf(sp, format, s->numbr); |