diff --git a/src/dusk/util/memory.c b/src/dusk/util/memory.c index ff69eb79..e6e90fa0 100644 --- a/src/dusk/util/memory.c +++ b/src/dusk/util/memory.c @@ -83,6 +83,9 @@ int_t memoryCompare( assertNotNull(a, "Cannot compare NULL memory."); assertNotNull(b, "Cannot compare NULL memory."); assertTrue(size >= 0, "Cannot compare negative bytes of memory."); + + if(size == 0) return 0; // Comparing 0 bytes is always equal + return memcmp(a, b, size); }