From 1a47b70c1d83adb73b3b8d2cb9e113489f3fbd76 Mon Sep 17 00:00:00 2001 From: Stefan Baltruweit Date: Wed, 24 Apr 2024 14:10:25 +0200 Subject: [PATCH] Add explicit cast to uint32_t Otherwise the condition is always true for 64-bit architectures. --- ff_fat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ff_fat.c b/ff_fat.c index 4114e91..0659ef4 100644 --- a/ff_fat.c +++ b/ff_fat.c @@ -712,7 +712,7 @@ uint32_t FF_FindEndOfChain( FF_IOManager_t * pxIOManager, { /* Traverse FAT for (2^32-1) items/clusters, * or until end-of-chain is encountered. */ - ulFatEntry = FF_TraverseFAT( pxIOManager, ulStart, ( uint32_t ) ~0UL, &xError ); + ulFatEntry = FF_TraverseFAT( pxIOManager, ulStart, ~( ( uint32_t ) 0U ) , &xError ); } else { @@ -1496,7 +1496,7 @@ uint32_t FF_CountFreeClusters( FF_IOManager_t * pxIOManager, { ulFreeClusters = FF_getLong( pxBuffer->pucBuffer, 488 ); - if( ulFreeClusters != ~0ul ) + if( ulFreeClusters != ~( ( uint32_t ) 0U ) ) { xInfoKnown = pdTRUE; }