~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to missing.d/memcmp.c

  • Committer: Arnold D. Robbins
  • Date: 2010-07-16 08:58:26 UTC
  • Revision ID: git-v1:765c7494b3dac62207e6cd57fb839997e237f292
Moving to 2.13.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * memcmp --- compare strings.
3
 
 *
4
 
 * We use our own routine since it has to act like strcmp() for return
5
 
 * value, and the BSD manual says bcmp() only returns zero/non-zero.
6
 
 */
7
 
 
8
 
int
9
 
memcmp (s1, s2, l)
10
 
register char *s1, *s2;
11
 
register int l;
12
 
{
13
 
        for (; l--; s1++, s2++) {
14
 
                if (*s1 != *s2)
15
 
                        return (*s1 - *s2);
16
 
        }
17
 
        return (*--s1 - *--s2);
18
 
}