Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Apr 2009 15:00:37 +0100 (BST)
From:      Richard Tobin <richard@inf.ed.ac.uk>
To:        Olivier Houchard <mlfbsd@ci0.org>, Gavin Atkinson <gavin@freebsd.org>
Cc:        Channa <channa.kad@gmail.com>, freebsd-arm@freebsd.org
Subject:   Re: strncmp issue
Message-ID:  <20090428140037.342BB6682CD@macpro.inf.ed.ac.uk>
In-Reply-To: Olivier Houchard's message of Tue, 28 Apr 2009 13:55:10 %2B0200

next in thread | raw e-mail | index | archive | help
> This shouldn't be an issue, as the second argument of strncmp is unsigned,
(you mean third)
> -1 is not a valid value.

In the presence of a prototype, -1 will be converted to the maximum
value of the unsigned type.  So strncmp(x, y, -1) should be much
the same as strcmp(x, y).

-- Richard

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090428140037.342BB6682CD>