diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2019-10-02 02:35:14 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2019-10-02 02:35:14 +0000 |
commit | a4626a7b3ed64eac59c7905c5d2f997ffd1bedb2 (patch) | |
tree | a38be292d73ae8293780c9d009dc121ba0b13c10 /libgfortran/io/write.c | |
parent | 8dc7a6f2a59b252cb756bd1f450558a4850cb6d2 (diff) | |
download | gcc-a4626a7b3ed64eac59c7905c5d2f997ffd1bedb2.zip gcc-a4626a7b3ed64eac59c7905c5d2f997ffd1bedb2.tar.gz gcc-a4626a7b3ed64eac59c7905c5d2f997ffd1bedb2.tar.bz2 |
re PR libfortran/91593 (Implicit enum conversions in libgfortran/io/transfer.c)
2019-10-01 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/91593
* io/read.c (read_decimal): Cast constant to size_t to turn off
a bogus warning.
* io/write.c (btoa_big): Use memset in lieu of setting the null
byte in a string buffer to turn off a bogus warning.
From-SVN: r276439
Diffstat (limited to 'libgfortran/io/write.c')
-rw-r--r-- | libgfortran/io/write.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c index 4ef3556..eacd1f7 100644 --- a/libgfortran/io/write.c +++ b/libgfortran/io/write.c @@ -1048,8 +1048,6 @@ btoa_big (const char *s, char *buffer, int len, GFC_UINTEGER_LARGEST *n) } } - *q = '\0'; - if (*n == 0) return "0"; @@ -1207,6 +1205,9 @@ write_b (st_parameter_dt *dtp, const fnode *f, const char *source, int len) char itoa_buf[GFC_BTOA_BUF_SIZE]; GFC_UINTEGER_LARGEST n = 0; + /* Ensure we end up with a null terminated string. */ + memset(itoa_buf, '\0', GFC_BTOA_BUF_SIZE); + if (len > (int) sizeof (GFC_UINTEGER_LARGEST)) { p = btoa_big (source, itoa_buf, len, &n); |