]> git.ipfire.org Git - thirdparty/squid.git/blob - compat/strnrchr.c
SourceFormat Enforcement
[thirdparty/squid.git] / compat / strnrchr.c
1 /*
2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #include "squid.h"
10 #include "strnrchr.h"
11
12 const char *
13 strnrchr(const char *s, size_t count, int c)
14 {
15 const char *rv=NULL;
16 const char *l=s;
17 while (count > 0 && *l != 0) {
18 if (*l==c)
19 rv=l;
20 ++l;
21 --count;
22 }
23 return rv;
24 }
25