2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Rename snprintf replacement rpl_snprintf since we may now replace

the libc version and #define rpl_snprintf snprintf in missing.h so
we get our version when needed.  This is consistent with how we
replace glob and fnmatch.
This commit is contained in:
Todd C. Miller
2013-11-19 16:06:08 -07:00
parent 4075ee77cf
commit 192cbbb490
2 changed files with 20 additions and 12 deletions

View File

@@ -394,17 +394,25 @@ int utimes(const char *, const struct timeval *);
#ifdef HAVE_FUTIME
int futimes(int, const struct timeval *);
#endif
#ifndef HAVE_SNPRINTF
int snprintf(char *, size_t, const char *, ...) __printflike(3, 4);
#if !defined(HAVE_SNPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
int rpl_snprintf(char *, size_t, const char *, ...) __printflike(3, 4);
# undef snprintf
# define snprintf rpl_snprintf
#endif
#ifndef HAVE_VSNPRINTF
int vsnprintf(char *, size_t, const char *, va_list) __printflike(3, 0);
#if !defined(HAVE_VSNPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
int rpl_vsnprintf(char *, size_t, const char *, va_list) __printflike(3, 0);
# undef vsnprintf
# define vsnprintf rpl_vsnprintf
#endif
#ifndef HAVE_ASPRINTF
int asprintf(char **, const char *, ...) __printflike(2, 3);
#if !defined(HAVE_ASPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
int rpl_asprintf(char **, const char *, ...) __printflike(2, 3);
# undef asprintf
# define asprintf rpl_asprintf
#endif
#ifndef HAVE_VASPRINTF
int vasprintf(char **, const char *, va_list) __printflike(2, 0);
#if !defined(HAVE_VASPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
int rpl_vasprintf(char **, const char *, va_list) __printflike(2, 0);
# undef vasprintf
# define vasprintf rpl_vasprintf
#endif
#ifndef HAVE_STRLCAT
size_t strlcat(char *, const char *, size_t);