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
+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.
+
2019-09-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/91593
/* This is a legacy extension, and the frontend will only allow such cases
* through when -fdec-format-defaults is passed.
*/
- if (w == DEFAULT_WIDTH)
+ if (w == (size_t) DEFAULT_WIDTH)
w = default_width_for_integer (length);
p = read_block_form (dtp, &w);
}
}
- *q = '\0';
-
if (*n == 0)
return "0";
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);