Skip to content

Commit

Permalink
Fix -Wunterminated-string-initialization warning
Browse files Browse the repository at this point in the history
Unbreaks the Cygwin build.
  • Loading branch information
bnoordhuis committed Jan 5, 2025
1 parent b675a95 commit 2a68c7b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion cutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,13 @@ size_t utf8_encode_buf16(char *dest, size_t dest_len, const uint16_t *src, size_
*/

/* 2 <= base <= 36 */
char const digits36[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
char const digits36[36] = {
'0','1','2','3','4','5','6','7','8','9',
'a','b','c','d','e','f','g','h','i','j',
'k','l','m','n','o','p','q','r','s','t',
'u','v','w','x','y','z'
};


#define USE_SPECIAL_RADIX_10 1 // special case base 10 radix conversions
#define USE_SINGLE_CASE_FAST 1 // special case single digit numbers
Expand Down
7 changes: 6 additions & 1 deletion tests/test_conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ size_t i64toa_radix(char buf[minimum_length(66)], int64_t n, unsigned base);
*/

/* 2 <= base <= 36 */
char const digits36[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
char const digits36[36] = {
'0','1','2','3','4','5','6','7','8','9',
'a','b','c','d','e','f','g','h','i','j',
'k','l','m','n','o','p','q','r','s','t',
'u','v','w','x','y','z'
};

/*---- variants ----*/

Expand Down

0 comments on commit 2a68c7b

Please sign in to comment.