Commit 38068dc1d3cf4a0f0dc2ce8c488a1de4621c04b5

Vicent Martí 2011-11-07T06:27:49

Merge pull request #473 from drafnel/bc/update-examples bc/update examples

diff --git a/examples/general.c b/examples/general.c
index 9bfbc40..8b58fa6 100644
--- a/examples/general.c
+++ b/examples/general.c
@@ -430,14 +430,14 @@ int main (int argc, char** argv)
   printf("\n*Config Listing*\n");
 
   const char *email;
-  int j;
+  int32_t j;
 
   git_config *cfg;
 
   // Open a config object so we can read global values from it.
   git_config_open_ondisk(&cfg, "~/.gitconfig");
 
-  git_config_get_int(cfg, "help.autocorrect", &j);
+  git_config_get_int32(cfg, "help.autocorrect", &j);
   printf("Autocorrect: %d\n", j);
 
   git_config_get_string(cfg, "user.email", &email);
diff --git a/examples/network/.gitignore b/examples/network/.gitignore
new file mode 100644
index 0000000..1b48e66
--- /dev/null
+++ b/examples/network/.gitignore
@@ -0,0 +1 @@
+/git2
diff --git a/examples/network/fetch.c b/examples/network/fetch.c
index 35fc3ea..dd732f2 100644
--- a/examples/network/fetch.c
+++ b/examples/network/fetch.c
@@ -119,7 +119,7 @@ int fetch(git_repository *repo, int argc, char **argv)
   if (error < GIT_SUCCESS)
     return error;
 
-  git__free(packname);
+  free(packname);
   git_indexer_free(idx);
   git_remote_free(remote);
 
diff --git a/examples/network/git2.c b/examples/network/git2.c
index 0468c8a..def56e8 100644
--- a/examples/network/git2.c
+++ b/examples/network/git2.c
@@ -44,7 +44,8 @@ int main(int argc, char **argv)
 	int i, error;
 
 	if (argc < 2) {
-		fprintf(stderr, "usage: %s <cmd> [repo]", argv[0]);
+		fprintf(stderr, "usage: %s <cmd> [repo]\n", argv[0]);
+		exit(EXIT_FAILURE);
 	}
 
 	for (i = 0; commands[i].name != NULL; ++i) {
@@ -53,5 +54,5 @@ int main(int argc, char **argv)
 	}
 
 	fprintf(stderr, "Command not found: %s\n", argv[1]);
-  
+	return 1;
 }