summaryrefslogtreecommitdiff
path: root/examples/network/fetch.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-04-09 11:40:00 -0700
committerRussell Belfer <rb@github.com>2013-04-09 11:40:00 -0700
commit9da187e83d1b8ab513a43fd54a9fe2be11b1703f (patch)
tree5a0ad82e821540fe5b23ee24c6fe53c9a59aa804 /examples/network/fetch.c
parent94750e8af246b2adf7bd5766e7e0da5fcf928d24 (diff)
downloadlibgit2-9da187e83d1b8ab513a43fd54a9fe2be11b1703f.tar.gz
Fix clang warnings and improve checks
Diffstat (limited to 'examples/network/fetch.c')
-rw-r--r--examples/network/fetch.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/network/fetch.c b/examples/network/fetch.c
index d5caad4de..6020ec6ec 100644
--- a/examples/network/fetch.c
+++ b/examples/network/fetch.c
@@ -16,7 +16,7 @@ struct dl_data {
static void progress_cb(const char *str, int len, void *data)
{
- data = data;
+ (void)data;
printf("remote: %.*s", len, str);
fflush(stdout); /* We don't have the \n to force the flush */
}
@@ -50,7 +50,7 @@ exit:
static int update_cb(const char *refname, const git_oid *a, const git_oid *b, void *data)
{
char a_str[GIT_OID_HEXSZ+1], b_str[GIT_OID_HEXSZ+1];
- data = data;
+ (void)data;
git_oid_fmt(b_str, b);
b_str[GIT_OID_HEXSZ] = '\0';
@@ -76,7 +76,11 @@ int fetch(git_repository *repo, int argc, char **argv)
pthread_t worker;
#endif
- argc = argc;
+ if (argc < 2) {
+ fprintf(stderr, "usage: %s fetch <repo>\n", argv[-1]);
+ return EXIT_FAILURE;
+ }
+
// Figure out whether it's a named remote or a URL
printf("Fetching %s for repo %p\n", argv[1], repo);
if (git_remote_load(&remote, repo, argv[1]) < 0) {