Skip to contentSkip to conversation

b64dec: use grub_size_t for function definition

PATCH In review Anaëlle Cazuc 2 participants 2 messages Sep 2, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 b64dec: use grub_size_t for function definition

On some targets, size_t and grub_size_t may not be the same type (unsigned long / unsigned int)
This breaks the compilation because the definition of gpgrt_b64dec_proc differs from its declaration
Fix it by using grub_size_t in the definition prototype

---
 grub-core/lib/b64dec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
grub-core/lib/b64dec.c +2 -2
index 868d98568..769cabda4 100644
@@ -100,8 +100,8 @@ _gpgrt_b64dec_start (const char *title)
 /* Do in-place decoding of base-64 data of LENGTH in BUFFER.  Stores the
    new length of the buffer at R_NBYTES. */
 gpg_err_code_t
-_gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer, size_t length,
-                    size_t *r_nbytes)
+_gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer, grub_size_t length,
+                    grub_size_t *r_nbytes)
 {
   enum decoder_states ds = state->idx;
   unsigned char val = state->radbuf[0];
Signature · 7 lines
2.39.5


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Anaëlle Cazuc

On some targets, size_t and grub_size_t may not be the same type (unsigned long / unsigned int)
This breaks the compilation because the definition of gpgrt_b64dec_proc differs from its declaration
Fix it by using grub_size_t in the definition prototype

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel