style fix: avoid comparison of pointer variable against 0 in got-fetch-pack
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
diff --git a/libexec/got-fetch-pack/got-fetch-pack.c b/libexec/got-fetch-pack/got-fetch-pack.c
index dd739fa..10f3a9c 100644
--- a/libexec/got-fetch-pack/got-fetch-pack.c
+++ b/libexec/got-fetch-pack/got-fetch-pack.c
@@ -1157,7 +1157,8 @@ main(int argc, char **argv)
return 1;
}
#endif
- if ((err = got_privsep_recv_imsg(&imsg, &ibuf, 0)) != 0) {
+ err = got_privsep_recv_imsg(&imsg, &ibuf, 0);
+ if (err) {
if (err->code == GOT_ERR_PRIVSEP_PIPE)
err = NULL;
goto done;
@@ -1184,7 +1185,8 @@ main(int argc, char **argv)
struct got_object_id *id;
char *refname;
- if ((err = got_privsep_recv_imsg(&imsg, &ibuf, 0)) != 0) {
+ err = got_privsep_recv_imsg(&imsg, &ibuf, 0);
+ if (err) {
if (err->code == GOT_ERR_PRIVSEP_PIPE)
err = NULL;
goto done;
@@ -1233,7 +1235,8 @@ main(int argc, char **argv)
for (i = 0; i < fetch_req.n_wanted_branches; i++) {
char *refname;
- if ((err = got_privsep_recv_imsg(&imsg, &ibuf, 0)) != 0) {
+ err = got_privsep_recv_imsg(&imsg, &ibuf, 0);
+ if (err) {
if (err->code == GOT_ERR_PRIVSEP_PIPE)
err = NULL;
goto done;
@@ -1274,7 +1277,8 @@ main(int argc, char **argv)
for (i = 0; i < fetch_req.n_wanted_refs; i++) {
char *refname;
- if ((err = got_privsep_recv_imsg(&imsg, &ibuf, 0)) != 0) {
+ err = got_privsep_recv_imsg(&imsg, &ibuf, 0);
+ if (err) {
if (err->code == GOT_ERR_PRIVSEP_PIPE)
err = NULL;
goto done;
@@ -1312,7 +1316,8 @@ main(int argc, char **argv)
imsg_free(&imsg);
}
- if ((err = got_privsep_recv_imsg(&imsg, &ibuf, 0)) != 0) {
+ err = got_privsep_recv_imsg(&imsg, &ibuf, 0);
+ if (err) {
if (err->code == GOT_ERR_PRIVSEP_PIPE)
err = NULL;
goto done;