[hackers] [sbase] libutil: Rename functions in reserved namespace to prevent potential conflict || Michael Forney

From: <git_AT_suckless.org>
Date: Sun, 26 May 2019 23:39:23 +0200 (CEST)

commit eeedfd87e55afaac8dca530b192e2a892723804c
Author: Michael Forney <mforney_AT_mforney.org>
AuthorDate: Mon May 20 00:13:09 2019 -0700
Commit: Michael Forney <mforney_AT_mforney.org>
CommitDate: Mon May 20 16:56:07 2019 -0700

    libutil: Rename functions in reserved namespace to prevent potential conflict
    
    libc may define functions with the same names, but differing in prototype.

diff --git a/util.h b/util.h
index 6c0aba9..8d5004b 100644
--- a/util.h
+++ b/util.h
_AT_@ -47,16 +47,20 @@ void weprintf(const char *, ...);
 double estrtod(const char *);
 
 #undef strcasestr
+#define strcasestr xstrcasestr
 char *strcasestr(const char *, const char *);
 
 #undef strlcat
+#define strlcat xstrlcat
 size_t strlcat(char *, const char *, size_t);
 size_t estrlcat(char *, const char *, size_t);
 #undef strlcpy
+#define strlcpy xstrlcpy
 size_t strlcpy(char *, const char *, size_t);
 size_t estrlcpy(char *, const char *, size_t);
 
 #undef strsep
+#define strsep xstrsep
 char *strsep(char **, const char *);
 
 /* regex */
_AT_@ -76,10 +80,12 @@ mode_t parsemode(const char *, mode_t, mode_t);
 off_t parseoffset(const char *);
 void putword(FILE *, const char *);
 #undef strtonum
+#define strtonum xstrtonum
 long long strtonum(const char *, long long, long long, const char **);
 long long enstrtonum(int, const char *, long long, long long);
 long long estrtonum(const char *, long long, long long);
 size_t unescape(char *);
 int mkdirp(const char *, mode_t, mode_t);
 #undef memmem
+#define memmem xmemmem
 void *memmem(const void *, size_t, const void *, size_t);
Received on Sun May 26 2019 - 23:39:23 CEST

This archive was generated by hypermail 2.3.0 : Sun May 26 2019 - 23:48:24 CEST