From 1e0513335f560b6d9530fd7010108bf14790ba93 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Fri, 19 Mar 1999 04:27:56 +0000 Subject: * Add strneq() (streq only n chars) macro * fix return type of xstrdup. --- make.h | 2 ++ misc.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/make.h b/make.h index d5bbe7e..b170d59 100644 --- a/make.h +++ b/make.h @@ -298,6 +298,8 @@ extern char *alloca (); # define strieq(a, b) (strcmp ((a), (b)) == 0) #endif +#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) + /* Add to VAR the hashing value of C, one character in a name. */ #define HASH(var, c) \ ((var += (c)), (var = ((var) << 7) + ((var) >> 20))) diff --git a/misc.c b/misc.c index 505b186..451a675 100644 --- a/misc.c +++ b/misc.c @@ -379,7 +379,7 @@ xrealloc (ptr, size) } -const char * +char * xstrdup (ptr) const char *ptr; { -- cgit v1.2.3