MISR Toolkit  1.5.1
strncasecmp.c
Go to the documentation of this file.
1 /*===========================================================================
2 = =
3 = strncasecmp =
4 = =
5 =============================================================================
6 
7  Jet Propulsion Laboratory
8  MISR
9  MISR Toolkit
10 
11 ============================================================================*/
12 
13 #include "MisrUtil.h"
14 #include <string.h>
15 #include <ctype.h>
16 
17 #ifndef strncasecmp
18 int strncasecmp(const char *s1, const char *s2, size_t n)
19 {
20  if (n == 0)
21  return 0;
22 
23  while((n-- != 0)
24  && (tolower(*(unsigned char *) s1) ==
25  tolower(*(unsigned char *) s2))) {
26  if (n == 0 || *s1 == '\0' || *s2 == '\0')
27  return 0;
28  s1++;
29  s2++;
30  }
31 
32  return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2);
33 }
34 #endif
35 
HDFFCLIBAPI _fcd _fcd intf * n
int strncasecmp(const char *s1, const char *s2, size_t n)
Definition: strncasecmp.c:18

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:52