mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-21 15:07:23 +00:00
Consistently use p_snprintf
This commit is contained in:
parent
2f795d8fc5
commit
c983604eb1
@ -749,9 +749,9 @@ replay:
|
|||||||
|
|
||||||
/* Verify that we got the correct content-type back */
|
/* Verify that we got the correct content-type back */
|
||||||
if (post_verb == s->verb)
|
if (post_verb == s->verb)
|
||||||
snprintf(expected_content_type_8, MAX_CONTENT_TYPE_LEN, "application/x-git-%s-result", s->service);
|
p_snprintf(expected_content_type_8, MAX_CONTENT_TYPE_LEN, "application/x-git-%s-result", s->service);
|
||||||
else
|
else
|
||||||
snprintf(expected_content_type_8, MAX_CONTENT_TYPE_LEN, "application/x-git-%s-advertisement", s->service);
|
p_snprintf(expected_content_type_8, MAX_CONTENT_TYPE_LEN, "application/x-git-%s-advertisement", s->service);
|
||||||
|
|
||||||
if (git__utf8_to_16(expected_content_type, MAX_CONTENT_TYPE_LEN, expected_content_type_8) < 0) {
|
if (git__utf8_to_16(expected_content_type, MAX_CONTENT_TYPE_LEN, expected_content_type_8) < 0) {
|
||||||
giterr_set(GITERR_OS, "Failed to convert expected content-type to wide characters");
|
giterr_set(GITERR_OS, "Failed to convert expected content-type to wide characters");
|
||||||
|
@ -15,13 +15,6 @@
|
|||||||
typedef unsigned short mode_t;
|
typedef unsigned short mode_t;
|
||||||
typedef SSIZE_T ssize_t;
|
typedef SSIZE_T ssize_t;
|
||||||
|
|
||||||
/* define snprintf using variadic macro support if available */
|
|
||||||
#if _MSC_VER >= 1500
|
|
||||||
# define snprintf(BUF, SZ, FMT, ...) _snprintf_s(BUF, SZ, _TRUNCATE, FMT, __VA_ARGS__)
|
|
||||||
#else
|
|
||||||
# define snprintf _snprintf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define GIT_STDLIB_CALL __cdecl
|
#define GIT_STDLIB_CALL __cdecl
|
||||||
|
@ -564,11 +564,19 @@ char *p_realpath(const char *orig_path, char *buffer)
|
|||||||
|
|
||||||
int p_vsnprintf(char *buffer, size_t count, const char *format, va_list argptr)
|
int p_vsnprintf(char *buffer, size_t count, const char *format, va_list argptr)
|
||||||
{
|
{
|
||||||
#if defined(_MSC_VER) && _MSC_VER >= 1500
|
#if defined(_MSC_VER)
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if (count == 0 ||
|
if (count == 0)
|
||||||
(len = _vsnprintf_s(buffer, count, _TRUNCATE, format, argptr)) < 0)
|
return _vscprintf(format, argptr);
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1500
|
||||||
|
len = _vsnprintf_s(buffer, count, _TRUNCATE, format, argptr);
|
||||||
|
#else
|
||||||
|
len = _vsnprintf(buffer, count, format, argptr);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (len < 0)
|
||||||
return _vscprintf(format, argptr);
|
return _vscprintf(format, argptr);
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
|
Loading…
Reference in New Issue
Block a user