Skip to content

Commit 38068dc

Browse files
author
Vicent Martí
committed
Merge pull request libgit2#473 from drafnel/bc/update-examples
bc/update examples
2 parents 3b83bda + 0b142c9 commit 38068dc

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

examples/general.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,14 +430,14 @@ int main (int argc, char** argv)
430430
printf("\n*Config Listing*\n");
431431

432432
const char *email;
433-
int j;
433+
int32_t j;
434434

435435
git_config *cfg;
436436

437437
// Open a config object so we can read global values from it.
438438
git_config_open_ondisk(&cfg, "~/.gitconfig");
439439

440-
git_config_get_int(cfg, "help.autocorrect", &j);
440+
git_config_get_int32(cfg, "help.autocorrect", &j);
441441
printf("Autocorrect: %d\n", j);
442442

443443
git_config_get_string(cfg, "user.email", &email);

examples/network/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/git2

examples/network/fetch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ int fetch(git_repository *repo, int argc, char **argv)
119119
if (error < GIT_SUCCESS)
120120
return error;
121121

122-
git__free(packname);
122+
free(packname);
123123
git_indexer_free(idx);
124124
git_remote_free(remote);
125125

examples/network/git2.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ int main(int argc, char **argv)
4444
int i, error;
4545

4646
if (argc < 2) {
47-
fprintf(stderr, "usage: %s <cmd> [repo]", argv[0]);
47+
fprintf(stderr, "usage: %s <cmd> [repo]\n", argv[0]);
48+
exit(EXIT_FAILURE);
4849
}
4950

5051
for (i = 0; commands[i].name != NULL; ++i) {
@@ -53,5 +54,5 @@ int main(int argc, char **argv)
5354
}
5455

5556
fprintf(stderr, "Command not found: %s\n", argv[1]);
56-
57+
return 1;
5758
}

0 commit comments

Comments
 (0)