X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Flib.c;h=1f563948adba55b1748b73613a5cab8f9dac453a;hb=ff036dcc7df8d27aa087d71c7e024ab81d550962;hp=9287d9c3d7f811c194627e16fd771628c499e278;hpb=41769c02317835472d7678d3531ecfc23df8e17a;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/lib.c b/Kernel/arch/x86/lib.c index 9287d9c3..1f563948 100644 --- a/Kernel/arch/x86/lib.c +++ b/Kernel/arch/x86/lib.c @@ -189,15 +189,16 @@ void *memsetd(void *Dest, Uint32 Val, size_t Num) */ int memcmp(const void *m1, const void *m2, size_t Num) { - if( Num == 0 ) return 1; // No bytes are always identical + if( Num == 0 ) return 0; // No bytes are always identical while(Num--) { - if(*(Uint8*)m1 != *(Uint8*)m2) break; + if(*(Uint8*)m1 != *(Uint8*)m2) + return *(Uint8*)m1 - *(Uint8*)m2; m1 ++; m2 ++; } - return *(Uint8*)m1 - *(Uint8*)m2; + return 0; } /**