summaryrefslogtreecommitdiffstats
path: root/gl/strncasecmp.c
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-11-06 09:24:23 +0100
committerGitHub <noreply@github.com>2024-11-06 09:24:23 +0100
commit9b4df9e50837cc837e113053ba12ee6967d5e6c2 (patch)
treebf989e771579f835bcb49c074637a8e224bcecbc /gl/strncasecmp.c
parent94150ae347beb25ac369d5773834ceef7f3736d3 (diff)
parent5be04ec2ceb1df77afbca4fcbf9e92a712612d6f (diff)
downloadmonitoring-plugins-9b4df9e.tar.gz
Merge pull request #2037 from RincewindsHat/update/gnulib-1.0
Sync with the latest Gnulib code (d4ec02b3cc) (gnulib v1.0)
Diffstat (limited to 'gl/strncasecmp.c')
-rw-r--r--gl/strncasecmp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gl/strncasecmp.c b/gl/strncasecmp.c
index c5c2cd35..c79161f3 100644
--- a/gl/strncasecmp.c
+++ b/gl/strncasecmp.c
@@ -1,5 +1,5 @@
1/* strncasecmp.c -- case insensitive string comparator 1/* strncasecmp.c -- case insensitive string comparator
2 Copyright (C) 1998-1999, 2005-2007, 2009-2023 Free Software Foundation, Inc. 2 Copyright (C) 1998-1999, 2005-2007, 2009-2024 Free Software Foundation, Inc.
3 3
4 This file is free software: you can redistribute it and/or modify 4 This file is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as 5 it under the terms of the GNU Lesser General Public License as
@@ -22,8 +22,6 @@
22#include <ctype.h> 22#include <ctype.h>
23#include <limits.h> 23#include <limits.h>
24 24
25#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
26
27/* Compare no more than N bytes of strings S1 and S2, ignoring case, 25/* Compare no more than N bytes of strings S1 and S2, ignoring case,
28 returning less than, equal to or greater than zero if S1 is 26 returning less than, equal to or greater than zero if S1 is
29 lexicographically less than, equal to or greater than S2. 27 lexicographically less than, equal to or greater than S2.
@@ -41,8 +39,8 @@ strncasecmp (const char *s1, const char *s2, size_t n)
41 39
42 do 40 do
43 { 41 {
44 c1 = TOLOWER (*p1); 42 c1 = tolower (*p1);
45 c2 = TOLOWER (*p2); 43 c2 = tolower (*p2);
46 44
47 if (--n == 0 || c1 == '\0') 45 if (--n == 0 || c1 == '\0')
48 break; 46 break;