Subject: lib/6344: manpage for strncasecmp(3) should note behaviour if len == 0
To: None <gnats-bugs@gnats.netbsd.org>
From: Jaromir Dolecek <dolecek@ics.muni.cz>
List: netbsd-bugs
Date: 10/22/1998 16:39:03
>Number:         6344
>Category:       lib
>Synopsis:       manpage for strncasecmp(3) should note behaviour if len == 0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 22 07:50:01 1998
>Last-Modified:
>Originator:     Jaromir Dolecek
>Organization:
	ICS MU, Brno, Czech Republic
>Release:        NetBSD-1.3.2
>Environment:
	
System: NetBSD saruman.ics.muni.cz 1.3.2 NetBSD 1.3.2 (SARUMAN) #0: Wed Jun 17 04:59:54 MEST 1998 dolecek@saruman.ics.muni.cz:/usr/home/dolecek/N132/usr/src/sys/arch/i386/compile/SARUMAN i386


>Description:
	Several times, i was catched by fact that if strncasecmp() is
	called with len == 0, it would return success. It should be noted
	in manpage, even through it's obvious.
>How-To-Repeat:
	do something like
	if (strncasecmp(prefix, other, strlen(prefix)) == 0)
		printf("other begins with prefix\n");
	and wonder why it works for empty prefix too.
>Fix:
	Add something like to strncasecmp() description:
	Note: if len is equal to zero, strncasecmp() returns sucess
	(i.e. 0) for any two compared strings.
>Audit-Trail:
>Unformatted: