Skip to content
Permalink
Browse files

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);
      |                ^
```
  • Loading branch information...
janisozaur authored and IntelOrca committed Mar 13, 2019
1 parent 5538fe3 commit 9554918e30c7366e6c00329ba12f206b7cb0ffe3
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/openrct2-ui/windows/ObjectLoadError.cpp
@@ -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);

0 comments on commit 9554918

Please sign in to comment.
You can’t perform that action at this time.