+2021-05-27 Alan Modra <amodra@gmail.com>
+
+ * config/tc-nds32.c (do_pseudo_push_bhwd, do_pseudo_pop_bhwd),
+ (do_pseudo_pusha, do_pseudo_pushi): Avoid fortify strncpy bound
+ error.
+
2021-05-26 H.J. Lu <hongjiu.lu@intel.com>
PR ld/27905
if (argc == 2)
{
- strncpy (location, argv[1], 8);
- location[7] = '\0';
+ strncpy (location, argv[1], sizeof (location) - 1);
+ location[sizeof (location) - 1] = '\0';
}
md_assemblef ("l.%c $ta,%s", size, argv[0]);
if (argc == 3)
{
- strncpy (location, argv[2], 8);
- location[7] = '\0';
+ strncpy (location, argv[2], sizeof (location) - 1);
+ location[sizeof (location) - 1] = '\0';
}
if ((pv & 0x3) == 0x3) /* double-word */
if (argc == 2)
{
- strncpy (location, argv[1], 8);
- location[7] = '\0';
+ strncpy (location, argv[1], sizeof (location) - 1);
+ location[sizeof (location) - 1] = '\0';
}
md_assemblef ("la $ta,%s", argv[0]);
if (argc == 2)
{
- strncpy (location, argv[1], 8);
- location[7] = '\0';
+ strncpy (location, argv[1], sizeof (location) - 1);
+ location[sizeof (location) - 1] = '\0';
}
md_assemblef ("li $ta,%s", argv[0]);