mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-20 02:42:09 +03:00
src: more tolerant snprintf() local override (#881)
`#undef snprintf` before redefining it, when `HAVE_SNPRINTF` is not defined, even though `snprintf` is available and it should have been. Possibly with 3rd party builds. Downside is that cases of missing `HAVE_SNPRINTF` are less trivially detected at compile-time.
This commit is contained in:
@@ -135,6 +135,7 @@
|
|||||||
/* Use local implementation when not available */
|
/* Use local implementation when not available */
|
||||||
#if !defined(HAVE_SNPRINTF)
|
#if !defined(HAVE_SNPRINTF)
|
||||||
#define LIBSSH2_SNPRINTF
|
#define LIBSSH2_SNPRINTF
|
||||||
|
#undef snprintf
|
||||||
#define snprintf _libssh2_snprintf
|
#define snprintf _libssh2_snprintf
|
||||||
int _libssh2_snprintf(char *cp, size_t cp_max_len, const char *fmt, ...);
|
int _libssh2_snprintf(char *cp, size_t cp_max_len, const char *fmt, ...);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user