Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
c983604e
Commit
c983604e
authored
Jul 12, 2014
by
Jacques Germishuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consistently use p_snprintf
parent
2f795d8f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
src/transports/winhttp.c
+2
-2
src/win32/msvc-compat.h
+0
-7
src/win32/posix_w32.c
+11
-3
No files found.
src/transports/winhttp.c
View file @
c983604e
...
...
@@ -749,9 +749,9 @@ replay:
/* Verify that we got the correct content-type back */
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
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
)
{
giterr_set
(
GITERR_OS
,
"Failed to convert expected content-type to wide characters"
);
...
...
src/win32/msvc-compat.h
View file @
c983604e
...
...
@@ -15,13 +15,6 @@
typedef
unsigned
short
mode_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
#define GIT_STDLIB_CALL __cdecl
...
...
src/win32/posix_w32.c
View file @
c983604e
...
...
@@ -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
)
{
#if defined(_MSC_VER)
&& _MSC_VER >= 1500
#if defined(_MSC_VER)
int
len
;
if
(
count
==
0
||
(
len
=
_vsnprintf_s
(
buffer
,
count
,
_TRUNCATE
,
format
,
argptr
))
<
0
)
if
(
count
==
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
len
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment