contrib/git-credential-gnome-keyring.c: *style* use "if ()" not "if()" etc.
Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Casey committed
Sep 23, 2013 at 11:49 UTC
4bc47cc009b82d89be3276fe5af3b03772e19c80
1 file changed
+10
-10
contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
+10
-10
@@ -117,10 +117,10 @@ static char* keyring_object(struct credential *c)
117
return object;
118
119
object = (char*) malloc(strlen(c->host)+strlen(c->path)+8);
120
- if(!object)
120
+ if (!object)
121
die_errno(errno);
122
123
- if(c->port)
123
+ if (c->port)
124
sprintf(object,"%s:%hd/%s",c->host,c->port,c->path);
125
else
126
sprintf(object,"%s/%s",c->host,c->path);
@@ -314,14 +314,14 @@ int credential_read(struct credential *c)
314
{
315
line_len = strlen(buf);
316
317
- if(buf[line_len-1]=='\n')
317
+ if (buf[line_len-1]=='\n')
318
buf[--line_len]='\0';
319
320
- if(!line_len)
320
+ if (!line_len)
321
break;
322
323
value = strchr(buf,'=');
324
- if(!value) {
324
+ if (!value) {
325
warning("invalid credential line: %s", key);
326
return -1;
327
}
@@ -379,9 +379,9 @@ static void usage(const char *name)
379
380
basename = (basename) ? basename + 1 : name;
381
fprintf(stderr, "usage: %s <", basename);
382
- while(try_op->name) {
382
+ while (try_op->name) {
383
fprintf(stderr,"%s",(try_op++)->name);
384
- if(try_op->name)
384
+ if (try_op->name)
385
fprintf(stderr,"%s","|");
386
}
387
fprintf(stderr,"%s",">\n");
@@ -400,15 +400,15 @@ int main(int argc, char *argv[])
400
}
401
402
/* lookup operation callback */
403
- while(try_op->name && strcmp(argv[1], try_op->name))
403
+ while (try_op->name && strcmp(argv[1], try_op->name))
404
try_op++;
405
406
/* unsupported operation given -- ignore silently */
407
- if(!try_op->name || !try_op->op)
407
+ if (!try_op->name || !try_op->op)
408
goto out;
409
410
ret = credential_read(&cred);
411
- if(ret)
411
+ if (ret)
412
goto out;
413
414
/* perform credential operation */