script: avoid gcc -Wstringop-overread for strnlen

This commit is contained in:
Nigel Tao committed 2024-07-27 09:33:39 +10:00
1 parent ce1f59e9ce
commit a7fb1e8d69
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -418,7 +418,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);
}
fprintf(stderr, "%s\n", status_msg);
// Return an exit code of 1 for regular (foreseen) errors, e.g. badly
+1 -1
View File
@@ -307,7 +307,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);
}
fprintf(stderr, "%s\n", status_msg);
// Return an exit code of 1 for regular (foreseen) errors, e.g. badly