File: memcmp.c

package info (click to toggle)
uucp 1.07-31
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,180 kB
  • sloc: ansic: 53,821; sh: 4,477; makefile: 202; perl: 199
file content (19 lines) | stat: -rw-r--r-- 349 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* memcmp.c
   Compare two memory buffers.  */

#include "uucp.h"

int
memcmp (p1arg, p2arg, c)
     constpointer p1arg;
     constpointer p2arg;
     size_t c;
{
  const char *p1 = (const char *) p1arg;
  const char *p2 = (const char *) p2arg;

  while (c-- != 0)
    if (*p1++ != *p2++)
      return BUCHAR (*--p1) - BUCHAR (*--p2);
  return 0;
}