sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit eeedfd87e55afaac8dca530b192e2a892723804c
parent 036449cdf13b5fd9364f7b9cc910fce7923ee4bf
Author: Michael Forney <mforney@mforney.org>
Date:   Mon, 20 May 2019 00:13:09 -0700

libutil: Rename functions in reserved namespace to prevent potential conflict

libc may define functions with the same names, but differing in prototype.

Diffstat:
Mutil.h | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/util.h b/util.h @@ -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 */ @@ -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);