1*599546b3Sderaadt /* $OpenBSD: strcmp.c,v 1.5 2003/08/11 06:23:09 deraadt Exp $ */
2dadd676aSmickey
3dadd676aSmickey /*-
4dadd676aSmickey * Copyright (c) 1996 Michael Shalayeff
5dadd676aSmickey * All rights reserved.
6dadd676aSmickey *
7dadd676aSmickey * Redistribution and use in source and binary forms, with or without
8dadd676aSmickey * modification, are permitted provided that the following conditions
9dadd676aSmickey * are met:
10dadd676aSmickey * 1. Redistributions of source code must retain the above copyright
11dadd676aSmickey * notice, this list of conditions and the following disclaimer.
12dadd676aSmickey * 2. Redistributions in binary form must reproduce the above copyright
13dadd676aSmickey * notice, this list of conditions and the following disclaimer in the
14dadd676aSmickey * documentation and/or other materials provided with the distribution.
15dadd676aSmickey *
16dadd676aSmickey * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17dadd676aSmickey * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18dadd676aSmickey * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19dadd676aSmickey * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20dadd676aSmickey * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21dadd676aSmickey * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22dadd676aSmickey * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23dadd676aSmickey * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24dadd676aSmickey * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25dadd676aSmickey * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26dadd676aSmickey * SUCH DAMAGE.
27dadd676aSmickey *
28dadd676aSmickey */
29dadd676aSmickey
30dadd676aSmickey #include <sys/types.h>
31dadd676aSmickey #include "stand.h"
32dadd676aSmickey
33dadd676aSmickey int
strcmp(const char * s1,const char * s2)34*599546b3Sderaadt strcmp(const char *s1, const char *s2)
35dadd676aSmickey {
36e31e80fdSmickey while(*s1 && *s2 && *s1 == *s2)
37e31e80fdSmickey s1++, s2++;
38e31e80fdSmickey return *s1 - *s2;
39dadd676aSmickey }
40