1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-21 14:00:51 +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:
Viktor Szakats
2023-03-27 11:27:59 +02:00
committed by GitHub
parent a3d42f41d0
commit 4f28eec947

View File

@@ -135,6 +135,7 @@
/* Use local implementation when not available */
#if !defined(HAVE_SNPRINTF)
#define LIBSSH2_SNPRINTF
#undef snprintf
#define snprintf _libssh2_snprintf
int _libssh2_snprintf(char *cp, size_t cp_max_len, const char *fmt, ...);
#endif