Skip to content

Commit 2f14c4f

Browse files
committed
w32_stack: convert buffer length param to size_t
In both `git_win32__stack_format` and `git_win32__stack`, we handle buffer lengths via an integer variable. As we only ever pass buffer sizes to it, this should be a `size_t` though to avoid loss of precision. As we also use it to compare with other `size_t` variables, this also silences signed/unsigned comparison warnings.
1 parent 77d7e5e commit 2f14c4f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/win32/w32_stack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int git_win32__stack_compare(
7676
}
7777

7878
int git_win32__stack_format(
79-
char *pbuf, int buf_len,
79+
char *pbuf, size_t buf_len,
8080
const git_win32__stack__raw_data *pdata,
8181
const char *prefix, const char *suffix)
8282
{
@@ -171,7 +171,7 @@ int git_win32__stack_format(
171171
}
172172

173173
int git_win32__stack(
174-
char * pbuf, int buf_len,
174+
char * pbuf, size_t buf_len,
175175
int skip,
176176
const char *prefix, const char *suffix)
177177
{

src/win32/w32_stack.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ int git_win32__stack_compare(
116116
* @param suffix String written after each frame; defaults to "\n".
117117
*/
118118
int git_win32__stack_format(
119-
char *pbuf, int buf_len,
119+
char *pbuf, size_t buf_len,
120120
const git_win32__stack__raw_data *pdata,
121121
const char *prefix, const char *suffix);
122122

@@ -132,7 +132,7 @@ int git_win32__stack_format(
132132
* @param suffix String written after each frame; defaults to "\n".
133133
*/
134134
int git_win32__stack(
135-
char * pbuf, int buf_len,
135+
char * pbuf, size_t buf_len,
136136
int skip,
137137
const char *prefix, const char *suffix);
138138

0 commit comments

Comments
 (0)