1: /*	@(#)strncmp.c	2.1	SCCS id keyword	*/
   2: /*
   3:  * Compare strings (at most n bytes):  s1>s2: >0  s1==s2: 0  s1<s2: <0
   4:  */
   5: 
   6: strncmp(s1, s2, n)
   7: register char *s1, *s2;
   8: register n;
   9: {
  10: 
  11:     while (--n >= 0 && *s1 == *s2++)
  12:         if (*s1++ == '\0')
  13:             return(0);
  14:     return(n<0 ? 0 : *s1 - *--s2);
  15: }

Defined functions

strncmp defined in line 6; used 96 times
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 780
Valid CSS Valid XHTML 1.0 Strict