Skip to content

Commit e583334

Browse files
committed
Fix broken build when MSVC SDL checks is enabled
1 parent b6cc559 commit e583334

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ int git_commit_nth_gen_ancestor(
292292
const git_commit *commit,
293293
unsigned int n)
294294
{
295-
git_commit *current, *parent;
295+
git_commit *current, *parent = NULL;
296296
int error;
297297

298298
assert(ancestor && commit);

src/config_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static int file_foreach(
296296

297297
static int config_set(git_config_backend *cfg, const char *name, const char *value)
298298
{
299-
cvar_t *var = NULL, *old_var;
299+
cvar_t *var = NULL, *old_var = NULL;
300300
diskfile_backend *b = (diskfile_backend *)cfg;
301301
char *key, *esc_value = NULL;
302302
khiter_t pos;

src/object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ int git_object_lookup_prefix(
117117
{
118118
git_object *object = NULL;
119119
git_odb *odb = NULL;
120-
git_odb_object *odb_obj;
120+
git_odb_object *odb_obj = NULL;
121121
int error = 0;
122122

123123
assert(repo && object_out && id);

src/push.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ int git_push_update_tips(git_push *push)
180180
git_buf remote_ref_name = GIT_BUF_INIT;
181181
size_t i, j;
182182
git_refspec *fetch_spec;
183-
push_spec *push_spec;
183+
push_spec *push_spec = NULL;
184184
git_reference *remote_ref;
185185
push_status *status;
186186
int error = 0;

src/transports/smart_protocol.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ int git_smart__store_refs(transport_smart *t, int flushes)
2121
gitno_buffer *buf = &t->buffer;
2222
git_vector *refs = &t->refs;
2323
int error, flush = 0, recvd;
24-
const char *line_end;
25-
git_pkt *pkt;
24+
const char *line_end = NULL;
25+
git_pkt *pkt = NULL;
2626
git_pkt_ref *ref;
2727
size_t i;
2828

@@ -135,7 +135,7 @@ int git_smart__detect_caps(git_pkt_ref *pkt, transport_smart_caps *caps)
135135
static int recv_pkt(git_pkt **out, gitno_buffer *buf)
136136
{
137137
const char *ptr = buf->data, *line_end = ptr;
138-
git_pkt *pkt;
138+
git_pkt *pkt = NULL;
139139
int pkt_type, error = 0, ret;
140140

141141
do {
@@ -640,8 +640,8 @@ static int add_push_report_sideband_pkt(git_push *push, git_pkt_data *data_pkt)
640640

641641
static int parse_report(gitno_buffer *buf, git_push *push)
642642
{
643-
git_pkt *pkt;
644-
const char *line_end;
643+
git_pkt *pkt = NULL;
644+
const char *line_end = NULL;
645645
int error, recvd;
646646

647647
for (;;) {

src/transports/winhttp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ static int winhttp_connect(
893893
wchar_t *ua = L"git/1.0 (libgit2 " WIDEN(LIBGIT2_VERSION) L")";
894894
wchar_t host[GIT_WIN_PATH];
895895
int32_t port;
896-
const char *default_port;
896+
const char *default_port = "80";
897897
int ret;
898898

899899
if (!git__prefixcmp(url, prefix_http)) {

0 commit comments

Comments
 (0)