mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-22 15:23:01 +01:00
Fix strncat size argument for GCC9 (#8855)
Previously, the (LTO) linker complained:
```
In function ‘copy_object_names_to_clipboard’,
inlined from ‘window_object_load_error_mouseup’ at ../src/openrct2-ui/windows/ObjectLoadError.cpp:450:43:
../src/openrct2-ui/windows/ObjectLoadError.cpp:358:16: error: ‘strncat’ specified bound 1 equals source length [-Werror=stringop-overflow=]
358 | strncat(buffer, PLATFORM_NEWLINE, line_sep_len);
| ^
```
This commit is contained in:
committed by
Ted John
parent
5538fe3ac5
commit
9554918e30
@@ -355,7 +355,7 @@ static void copy_object_names_to_clipboard(rct_window* w)
|
||||
}
|
||||
|
||||
strncat(buffer, _invalid_entries[i].name, nameLength);
|
||||
strncat(buffer, PLATFORM_NEWLINE, line_sep_len);
|
||||
strncat(buffer, PLATFORM_NEWLINE, buffer_len - strlen(buffer) - 1);
|
||||
}
|
||||
|
||||
platform_place_string_on_clipboard(buffer);
|
||||
|
||||
Reference in New Issue
Block a user