Stop insecurely covering up for lack of snprintf and vsnprintf
- we require C99 anyway - snprintf is used unconditionally all around the tree - if absolutely needed for portability, having insecure wrappers littered over the source is not the best way
This commit is contained in:
parent
de4085814e
commit
501197e5ef
19
lib/rpmps.c
19
lib/rpmps.c
|
@ -207,25 +207,6 @@ int rpmpsTrim(rpmps ps, rpmps filter)
|
|||
return gotProblems;
|
||||
}
|
||||
|
||||
#if !defined(HAVE_VSNPRINTF)
|
||||
static inline int vsnprintf(char * buf, int nb,
|
||||
const char * fmt, va_list ap)
|
||||
{
|
||||
return vsprintf(buf, fmt, ap);
|
||||
}
|
||||
#endif
|
||||
#if !defined(HAVE_SNPRINTF)
|
||||
static inline int snprintf(char * buf, int nb, const char * fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int rc;
|
||||
va_start(ap, fmt);
|
||||
rc = vsnprintf(buf, nb, fmt, ap);
|
||||
va_end(ap);
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
rpmProblem rpmProblemCreate(rpmProblemType type,
|
||||
const char * pkgNEVR,
|
||||
fnpyKey key,
|
||||
|
|
|
@ -162,14 +162,6 @@ const char * rpmlogLevelPrefix(rpmlogLvl pri)
|
|||
return prefix;
|
||||
}
|
||||
|
||||
#if !defined(HAVE_VSNPRINTF)
|
||||
static inline int vsnprintf(char * buf, int nb,
|
||||
const char * fmt, va_list ap)
|
||||
{
|
||||
return vsprintf(buf, fmt, ap);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* FIX: rpmlogMsgPrefix[] dependent, not unqualified */
|
||||
/* FIX: rpmlogMsgPrefix[] may be NULL */
|
||||
static void vrpmlog (unsigned code, const char *fmt, va_list ap)
|
||||
|
|
|
@ -21,14 +21,6 @@
|
|||
|
||||
#include "debug.h"
|
||||
|
||||
#if !defined(HAVE_VSNPRINTF)
|
||||
static inline int vsnprintf(char * buf, int nb,
|
||||
const char * fmt, va_list ap)
|
||||
{
|
||||
return vsprintf(buf, fmt, ap);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define INITSTATE(_lua, lua) \
|
||||
rpmlua lua = _lua ? _lua : \
|
||||
(globalLuaState ? globalLuaState : \
|
||||
|
|
Loading…
Reference in New Issue