style
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
diff --git a/lib/patch.c b/lib/patch.c
index acd793b..4aabb46 100644
--- a/lib/patch.c
+++ b/lib/patch.c
@@ -305,8 +305,8 @@ locate_hunk(FILE *orig, struct got_patch_hunk *h, off_t *pos, long *lineno)
}
(*lineno)++;
- if ((mode == ' ' && !strcmp(h->lines[0]+1, line)) ||
- (mode == '-' && !strcmp(h->lines[0]+1, line)) ||
+ if ((mode == ' ' && !strcmp(h->lines[0] + 1, line)) ||
+ (mode == '-' && !strcmp(h->lines[0] + 1, line)) ||
(mode == '+' && *lineno == h->old_from)) {
match = ftello(orig);
if (match == -1) {
@@ -355,7 +355,7 @@ test_hunk(FILE *orig, struct got_patch_hunk *h)
GOT_ERR_HUNK_FAILED);
goto done;
}
- if (strcmp(h->lines[i]+1, line)) {
+ if (strcmp(h->lines[i] + 1, line)) {
err = got_error(GOT_ERR_HUNK_FAILED);
goto done;
}
@@ -376,14 +376,14 @@ apply_hunk(FILE *tmp, struct got_patch_hunk *h, long *lineno)
for (i = 0; i < h->len; ++i) {
switch (*h->lines[i]) {
case ' ':
- if (fprintf(tmp, "%s", h->lines[i]+1) < 0)
+ if (fprintf(tmp, "%s", h->lines[i] + 1) < 0)
return got_error_from_errno("fprintf");
/* fallthrough */
case '-':
(*lineno)++;
break;
case '+':
- if (fprintf(tmp, "%s", h->lines[i]+1) < 0)
+ if (fprintf(tmp, "%s", h->lines[i] + 1) < 0)
return got_error_from_errno("fprintf");
break;
}
@@ -413,7 +413,7 @@ patch_file(struct got_patch *p, const char *path, FILE *tmp, int nop,
if (nop)
return NULL;
for (i = 0; i < h->len; ++i) {
- if (fprintf(tmp, "%s", h->lines[i]+1) < 0)
+ if (fprintf(tmp, "%s", h->lines[i] + 1) < 0)
return got_error_from_errno("fprintf");
}
return err;
diff --git a/libexec/got-read-patch/got-read-patch.c b/libexec/got-read-patch/got-read-patch.c
index 0f19ba3..deb0e81 100644
--- a/libexec/got-read-patch/got-read-patch.c
+++ b/libexec/got-read-patch/got-read-patch.c
@@ -103,7 +103,7 @@ filename(const char *at, char **name, int strip)
at++;
/* files can be created or removed by diffing against /dev/null */
- if (!strncmp(at, _PATH_DEVNULL, sizeof(_PATH_DEVNULL)-1))
+ if (!strncmp(at, _PATH_DEVNULL, sizeof(_PATH_DEVNULL) - 1))
return NULL;
t = strdup(at);
@@ -118,7 +118,7 @@ filename(const char *at, char **name, int strip)
++t) {
if (t[0] == '/' && t[1] != '/' && t[1] != '\0')
if (--l >= 0)
- *name = t+1;
+ *name = t + 1;
}
*t = '\0';
@@ -292,7 +292,7 @@ send_line(const char *line)
}
if (imsg_compose(&ibuf, GOT_IMSG_PATCH_LINE, 0, 0, -1,
- line, strlen(line)+1) == -1)
+ line, strlen(line) + 1) == -1)
err = got_error_from_errno(
"imsg_compose GOT_IMSG_PATCH_LINE");