diff options
author | Alan Modra <amodra@gmail.com> | 2020-02-26 12:38:11 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-02-26 13:04:48 +1030 |
commit | 42135cadf5a3097df340eb85e96c0109a9842907 (patch) | |
tree | ab3cc080c902040c0266078b0de725827cd206b2 /gas/read.c | |
parent | dc1e8a474f904419abaa27da4be5b0f735a87255 (diff) | |
download | gdb-42135cadf5a3097df340eb85e96c0109a9842907.zip gdb-42135cadf5a3097df340eb85e96c0109a9842907.tar.gz gdb-42135cadf5a3097df340eb85e96c0109a9842907.tar.bz2 |
gas strncpy warning
Avoid a warning that the buffer may not be zero terminated.
* read.c (read_a_source_file): Call strncpy with length one
less than size of original_case_string.
Diffstat (limited to 'gas/read.c')
-rw-r--r-- | gas/read.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1052,7 +1052,8 @@ read_a_source_file (const char *name) { char *s2 = s; - strncpy (original_case_string, s2, sizeof (original_case_string)); + strncpy (original_case_string, s2, + sizeof (original_case_string) - 1); original_case_string[sizeof (original_case_string) - 1] = 0; while (*s2) |