1: #if defined(LIBC_SCCS) && !defined(lint)
   2: static char sccsid[] = "@(#)strncmp.c	5.2 (Berkeley) 3/9/86";
   3: #endif LIBC_SCCS and not lint
   4: 
   5: /*
   6:  * Compare strings (at most n bytes):  s1>s2: >0  s1==s2: 0  s1<s2: <0
   7:  */
   8: 
   9: strncmp(s1, s2, n)
  10: register char *s1, *s2;
  11: register n;
  12: {
  13: 
  14:     while (--n >= 0 && *s1 == *s2++)
  15:         if (*s1++ == '\0')
  16:             return(0);
  17:     return(n<0 ? 0 : *s1 - *--s2);
  18: }

Defined functions

strncmp defined in line 9; never used

Defined variables

sccsid defined in line 2; never used
Last modified: 1986-03-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1306
Valid CSS Valid XHTML 1.0 Strict