mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
example: avoid gcc -Wstringop-overread for strnlen
This commit is contained in:
1 parent
d36277f0c0
commit
57b80f8c2e
4 files changed
+4
-4
No files matched your search
@@ -228,7 +228,7 @@ compute_exit_code(const char* status_msg) {
|
||||
size_t n = strnlen(status_msg, 2047);
|
||||
if (n >= 2047) {
|
||||
status_msg = "main: internal error: error message is too long";
|
||||
n = strnlen(status_msg, 2047);
|
||||
n = strlen(status_msg);
|
||||
}
|
||||
const int stderr_fd = 2;
|
||||
ignore_return_value(write(stderr_fd, status_msg, n));
|
||||
|
||||
Reference in new issue
Block a user