memcmp() is broken

Robert Andersson ra at is.uu.no
Wed Sep 5 04:56:12 AEST 1990


This is on a DECstation 3100 running Ultrix 3.1.  Am I dreaming, or is
really memcmp() broken?  I get wild results from the last two memcmp
calls.  Test program follows:

#include <memory.h>
#include <stdio.h>

main()
{
	/* These two work */
	printf("%d\n", memcmp("180", "200", 3));
	printf("%d\n", memcmp("200", "180", 3));
	/* But these don't */
	printf("%d\n", memcmp("1800", "2000", 4));
	printf("%d\n", memcmp("2000", "1800", 4));
}
-- 
Robert Andersson, International Systems A/S, Oslo, Norway.
Internet:         ra at is.uu.no
UUCP:             ...!{uunet,mcsun,ifi}!is.uu.no!ra



More information about the Comp.unix.ultrix mailing list