diff options
author | Alan Modra <amodra@gmail.com> | 2021-06-18 22:25:10 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-06-19 11:08:55 +0930 |
commit | d984392e752c43ec226a9d0df23af0c743e2b411 (patch) | |
tree | 1fbdbc1c64377ff815586161aa572b3f22d8c41a /opcodes | |
parent | 539b54f03dd082c572308246e610e516ff96b5b1 (diff) | |
download | gdb-d984392e752c43ec226a9d0df23af0c743e2b411.zip gdb-d984392e752c43ec226a9d0df23af0c743e2b411.tar.gz gdb-d984392e752c43ec226a9d0df23af0c743e2b411.tar.bz2 |
Fix another strncpy warning
* tic30-dis.c (get_register_operand): Don't ask strncpy to fill
entire buffer.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 5 | ||||
-rw-r--r-- | opcodes/tic30-dis.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 8f4b976..f262529 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2021-06-19 Alan Modra <amodra@gmail.com> + + * tic30-dis.c (get_register_operand): Don't ask strncpy to fill + entire buffer. + 2021-06-17 Alan Modra <amodra@gmail.com> * ppc-opc.c (powerpc_opcodes): Move cell db*cyc to proper location diff --git a/opcodes/tic30-dis.c b/opcodes/tic30-dis.c index bb96c07..a78a0da 100644 --- a/opcodes/tic30-dis.c +++ b/opcodes/tic30-dis.c @@ -201,7 +201,7 @@ get_register_operand (unsigned char fragment, char *buffer) { if ((fragment & 0x1F) == current_reg->opcode) { - strncpy (buffer, current_reg->name, OPERAND_BUFFER_LEN); + strncpy (buffer, current_reg->name, OPERAND_BUFFER_LEN - 1); buffer[OPERAND_BUFFER_LEN - 1] = 0; return 1; } |