Skip to content

Commit

Permalink
Convert the ascii64 constant from character array to C string.
Browse files Browse the repository at this point in the history
This fixes GCC 15 to complain about "unterminated-string-initialization".

Fixes #194.
  • Loading branch information
besser82 committed Dec 31, 2024
1 parent 785c7bd commit 55bc82b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions lib/crypt-port.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,8 @@ extern void
make_failure_token (const char *setting, char *output, int size);

/* The base-64 encoding table used by most hashing methods.
(bcrypt uses a slightly different encoding.) Size 65
because it's used as a C string in a few places. */
extern const unsigned char ascii64[65];
(bcrypt uses a slightly different encoding.) */
extern const unsigned char *ascii64;

/* Same table gets used with other names in various places. */
#define b64t ((const char *) ascii64)
Expand Down
6 changes: 3 additions & 3 deletions lib/util-base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

#include "crypt-port.h"

const unsigned char ascii64[65] =
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
const unsigned char *ascii64 =
(const unsigned char *)
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
/* 0000000000111111111122222222223333333333444444444455555555556666 */
/* 0123456789012345678901234567890123456789012345678901234567890123 */
"\x00";

0 comments on commit 55bc82b

Please sign in to comment.