File: strcasecmp.c

package info (click to toggle)
radiusclient 0.3.2-13
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,036 kB
  • ctags: 468
  • sloc: sh: 4,808; ansic: 3,645; perl: 258; makefile: 108
file content (36 lines) | stat: -rw-r--r-- 773 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * $Id: strcasecmp.c,v 1.1 1998/06/27 17:41:15 lf Exp $
 *
 * Copyright (C) 1996 Lars Fenneberg and Christian Graefe
 *
 * This file is provided under the terms and conditions of the GNU general 
 * public license, version 2 or any later version, incorporated herein by 
 * reference. 
 *
 */

#include "config.h"
#include "includes.h"

#ifdef HAVE_STRICMP
# define strcasecmp(a,b)	stricmp(a,b)
#else

/*
 * Function: strcasecmp
 *
 * Purpose:  strcasecmp replacement for systems which lack strcasecmp and
 *			 stricmp
 */

int strcasecmp(char *s1, char *s2)
{
	while (*s1 && *s2 && toupper(*s1) == toupper(*s2))
    	s1++, s2++;
        
    if (!*s1 && !*s2)
    	return 0;    
    else
    	return (toupper(*s1) - toupper(*s2));                            
}
#endif