undo repvious delta
[deliverable/binutils-gdb.git] / libiberty / bcmp.c
CommitLineData
252b5132
RH
1/* bcmp
2 This function is in the public domain. */
3
4/*
5
6NAME
7
8 bcmp -- compare two memory regions
9
10SYNOPSIS
11
12 int bcmp (char *from, char *to, int count)
13
14DESCRIPTION
15
16 Compare two memory regions and return zero if they are identical,
17 non-zero otherwise. If count is zero, return zero.
18
19NOTES
20
21 No guarantee is made about the non-zero returned value. In
22 particular, the results may be signficantly different than
23 strcmp(), where the return value is guaranteed to be less than,
24 equal to, or greater than zero, according to lexicographical
25 sorting of the compared regions.
26
27BUGS
28
29*/
30
31
32int
33bcmp (from, to, count)
34 char *from, *to;
35 int count;
36{
37 int rtnval = 0;
38
39 while (count-- > 0)
40 {
41 if (*from++ != *to++)
42 {
43 rtnval = 1;
44 break;
45 }
46 }
47 return (rtnval);
48}
49
This page took 0.045787 seconds and 4 git commands to generate.