aboutsummaryrefslogtreecommitdiff
path: root/lib/strequal.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-10-28 21:52:00 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-10-28 21:52:00 +0000
commit01387f42c582fdbebc12cee39ed91346bd42ec04 (patch)
treee403f027a594ae9f07156214b16a866a1fbc737c /lib/strequal.h
parent8f52b731f45eabd5b036b146a27e93ec7fa9e807 (diff)
kromJx@crosswinds.net's fix that now uses checkprefix() instead of
strnequal() when the third argument was strlen(first argument) anyway. This makes it less prone to errors. (Slightly edited by me)
Diffstat (limited to 'lib/strequal.h')
-rw-r--r--lib/strequal.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/strequal.h b/lib/strequal.h
index 005bb3e44..e63dc212e 100644
--- a/lib/strequal.h
+++ b/lib/strequal.h
@@ -32,6 +32,10 @@ int curl_strnequal(const char *first, const char *second, size_t max);
#define strequal(a,b) curl_strequal(a,b)
#define strnequal(a,b,c) curl_strnequal(a,b,c)
+/* checkprefix() is a shorter version of the above, used when the first
+ argument is zero-byte terminated */
+#define checkprefix(a,b) strnequal(a,b,strlen(a))
+
#ifndef HAVE_STRLCAT
#define strlcat(x,y,z) Curl_strlcat(x,y,z)
size_t Curl_strlcat(char *dst, const char *src, size_t siz);