From: Collin Funk Date: Mon, 26 May 2025 18:27:34 +0000 (-0700) Subject: crypto/gc: Pacify -Wformat warnings. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70ade64f1f38377d099061efd228d3f4287eaf90;p=thirdparty%2Fgnulib.git crypto/gc: Pacify -Wformat warnings. * lib/gc-gnulib.c (gc_cipher_setkey, gc_cipher_setiv): Cast the argument since "%02x" expects the argument to be unsigned. --- diff --git a/ChangeLog b/ChangeLog index 9e566bb5c3..a6728386ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2025-05-26 Collin Funk + + crypto/gc: Pacify -Wformat warnings. + * lib/gc-gnulib.c (gc_cipher_setkey, gc_cipher_setiv): Cast the argument + since "%02x" expects the argument to be unsigned. + 2025-05-26 Bruno Haible gnulib-tool: Remove build-aux/test-driver.orig from testdirs. diff --git a/lib/gc-gnulib.c b/lib/gc-gnulib.c index 4eaf9a7656..85b7a62b74 100644 --- a/lib/gc-gnulib.c +++ b/lib/gc-gnulib.c @@ -290,7 +290,8 @@ gc_cipher_setkey (gc_cipher_handle handle, size_t keylen, const char *key) char keyMaterial[RIJNDAEL_MAX_KEY_SIZE + 1]; for (i = 0; i < keylen; i++) - sprintf (&keyMaterial[2 * i], "%02x", key[i] & 0xFF); + sprintf (&keyMaterial[2 * i], "%02x", + (unsigned int) (key[i] & 0xFF)); rc = rijndaelMakeKey (&ctx->aesEncKey, RIJNDAEL_DIR_ENCRYPT, keylen * 8, keyMaterial); @@ -348,7 +349,8 @@ gc_cipher_setiv (gc_cipher_handle handle, size_t ivlen, const char *iv) char ivMaterial[2 * RIJNDAEL_MAX_IV_SIZE + 1]; for (i = 0; i < ivlen; i++) - sprintf (&ivMaterial[2 * i], "%02x", iv[i] & 0xFF); + sprintf (&ivMaterial[2 * i], "%02x", + (unsigned int) (iv[i] & 0xFF)); rc = rijndaelCipherInit (&ctx->aesContext, RIJNDAEL_MODE_CBC, ivMaterial);