summaryrefslogtreecommitdiff
path: root/src/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compat.c')
-rw-r--r--src/compat.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/compat.c b/src/compat.c
index 0279efec8..5b1a6f665 100644
--- a/src/compat.c
+++ b/src/compat.c
@@ -19,39 +19,39 @@
#if !HAVE_STRICMP && !HAVE_STRCASECMP
/* stricmp, strnicmp: Case-insensitive versions of strcmp() and
- * strncmp().
+ * strncmp().
*/
int stricmp(const char *s1, const char *s2)
{
- register int c;
-
- while ((c = tolower(*s1)) == tolower(*s2)) {
- if (c == 0)
- return 0;
- s1++;
- s2++;
- }
- if (c < tolower(*s2))
- return -1;
- return 1;
+ register int c;
+
+ while ((c = tolower(*s1)) == tolower(*s2)) {
+ if (c == 0)
+ return 0;
+ s1++;
+ s2++;
+ }
+ if (c < tolower(*s2))
+ return -1;
+ return 1;
}
int strnicmp(const char *s1, const char *s2, size_t len)
{
- register int c;
-
- if (!len)
- return 0;
- while ((c = tolower(*s1)) == tolower(*s2) && len > 0) {
- if (c == 0 || --len == 0)
- return 0;
- s1++;
- s2++;
- }
- if (c < tolower(*s2))
- return -1;
- return 1;
+ register int c;
+
+ if (!len)
+ return 0;
+ while ((c = tolower(*s1)) == tolower(*s2) && len > 0) {
+ if (c == 0 || --len == 0)
+ return 0;
+ s1++;
+ s2++;
+ }
+ if (c < tolower(*s2))
+ return -1;
+ return 1;
}
#endif