Author: mturk
Date: Sun Jul 19 07:02:39 2009
New Revision: 795486
URL: http://svn.apache.org/viewvc?rev=795486&view=rev
Log:
memcmp doesn't always returns -1/1
Modified:
commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c
Modified: commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c?rev=795486&r1=795485&r2=795486&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/pointer.c Sun Jul 19
07:02:39 2009
@@ -218,6 +218,8 @@
UNREFERENCED_STDARGS;
ACR_TRY {
rv = memcmp(N2P(a, void *), N2P(b, const void *), (size_t)n);
+ if (rv)
+ rv = rv > 0 ? 1 : -1;
} ACR_CATCH() {
ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ERUNTIME, ACR_EFAULT);
rv = -1;