Skip to content

Commit c90ab6a

Browse files
committed
Remove explicit \0 characters in constant strings to avoid new gcc 15 warnings
1 parent 494013d commit c90ab6a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/genkey/clu_genkey.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ int wolfCLU_genKey_ED25519(WC_RNG* rng, char* fOutNm, int directive, int format)
4040
int fOutNmSz; /* file name without append */
4141
int fOutNmAppendSz = 6; /* # of bytes to append to file name */
4242
int flagOutputPub = 0; /* set if outputting both priv/pub */
43-
char privAppend[6] = ".priv\0"; /* last part of the priv file name */
44-
char pubAppend[6] = ".pub\0\0"; /* last part of the pub file name*/
43+
char privAppend[6] = ".priv"; /* last part of the priv file name */
44+
char pubAppend[6] = ".pub"; /* last part of the pub file name*/
4545
byte privKeyBuf[ED25519_KEY_SIZE*2]; /* will hold public & private parts */
4646
byte pubKeyBuf[ED25519_KEY_SIZE]; /* holds just the public key part */
4747
word32 privKeySz; /* size of private key */
@@ -611,8 +611,8 @@ int wolfCLU_GenAndOutput_ECC(WC_RNG* rng, char* fName, int directive,
611611
#ifdef HAVE_ECC
612612
int fNameSz;
613613
int fExtSz = 6;
614-
char fExtPriv[6] = ".priv\0";
615-
char fExtPub[6] = ".pub\0\0";
614+
char fExtPriv[6] = ".priv";
615+
char fExtPub[6] = ".pub";
616616
char* fOutNameBuf = NULL;
617617

618618
WOLFSSL_BIO *bioPub = NULL;
@@ -790,8 +790,8 @@ int wolfCLU_genKey_RSA(WC_RNG* rng, char* fName, int directive, int fmt, int
790790
int ret = WOLFCLU_SUCCESS; /* return value */
791791
int fNameSz; /* file name without append */
792792
int fExtSz = 6; /* number of bytes to append to file name */
793-
char fExtPriv[6] = ".priv\0"; /* last part of the priv file name */
794-
char fExtPub[6] = ".pub\0\0"; /* last part of the pub file name*/
793+
char fExtPriv[6] = ".priv"; /* last part of the priv file name */
794+
char fExtPub[6] = ".pub"; /* last part of the pub file name*/
795795
char* fOutNameBuf = NULL; /* file name + fExt */
796796
int flagOutputPub = 0; /* set if outputting both priv/pub */
797797
byte* derBuf = NULL; /* buffer for DER format */

src/genkey/clu_genkey_setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int wolfCLU_genKeySetup(int argc, char** argv)
2929
{
3030
#ifndef WOLFCLU_NO_FILESYSTEM
3131
char keyOutFName[MAX_FILENAME_SZ]; /* default outFile for genKey */
32-
char defaultFormat[4] = "der\0";
32+
char defaultFormat[4] = "der";
3333
WC_RNG rng;
3434

3535
char* keyType = NULL; /* keyType */

0 commit comments

Comments
 (0)