-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed maybe-uninitialized warning in error creation.
Ensuring that buf is always initialized in njs_throw_error_va() and njs_error_fmt_new(), by requiring fmt to always be non NULL. This fixes GCC warnings like: 169 | njs_unicode_decode_t ctx; | ^ In function ‘njs_utf8_length’, inlined from ‘njs_error_new’ at src/njs_error.c:39:14, inlined from ‘njs_throw_error_va’ at src/njs_error.c:69:5: src/njs_utf8.h:141:12: error: ‘buf’ may be used uninitialized [-Werror=maybe-uninitialized] 141 | return njs_utf8_stream_length(&ctx, p, len, 1, 1, NULL);
- Loading branch information
Showing
4 changed files
with
29 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters