summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-06-27 11:00:38 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-06-27 11:01:32 -0400
commitc0913d90437752b9ad027c3c8c2fae66e6db72d0 (patch)
tree6ffa6f94cbb7db8cf57065fdfe84fc7b1191501f /git.c
parent7781d3baef7448f427f740ee2b6b9ad56d449c76 (diff)
Renamed `info_buf` to `file_buf` in
`create_info_file()`.
Diffstat (limited to 'git.c')
-rw-r--r--git.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/git.c b/git.c
index e8a1274..96fffa0 100644
--- a/git.c
+++ b/git.c
@@ -98,7 +98,7 @@ int create_info_file(pull_request *pr, const char *pr_root) {
int buf_len;
int j = 0;
char *filename;
- char *info_buf;
+ char *file_buf;
FILE *fp;
struct tm tm;
@@ -118,23 +118,23 @@ int create_info_file(pull_request *pr, const char *pr_root) {
len = strlen(pr_root) + strlen("/info");
buf_len = get_info_len(pr);
filename = calloc(len+1, sizeof(char));
- info_buf = calloc(buf_len+1, sizeof(char));
+ file_buf = calloc(buf_len+1, sizeof(char));
- j = sprintf(info_buf, "title: %s\n", pr->title);
- j += sprintf(info_buf+j, "author: %s\n", pr->author);
- j += sprintf(info_buf+j, "date: ");
- j += strftime(info_buf+j, -1, "%c %z\n", &tm);
- j += sprintf(info_buf+j, "description: %s\n", pr->desc);
- j += sprintf(info_buf+j, "type: %i\n", pr->pr_type);
+ j = sprintf(file_buf, "title: %s\n", pr->title);
+ j += sprintf(file_buf+j, "author: %s\n", pr->author);
+ j += sprintf(file_buf+j, "date: ");
+ j += strftime(file_buf+j, -1, "%c %z\n", &tm);
+ j += sprintf(file_buf+j, "description: %s\n", pr->desc);
+ j += sprintf(file_buf+j, "type: %i\n", pr->pr_type);
/* Is this PR using a remote branch? */
if (pr->pr_type) {
- j += sprintf(info_buf+j, "branch: %s\n", pr->branch->name);
- j += sprintf(info_buf+j, "repo: %s", pr->branch->repo);
+ j += sprintf(file_buf+j, "branch: %s\n", pr->branch->name);
+ j += sprintf(file_buf+j, "repo: %s", pr->branch->repo);
} else {
- j += sprintf(info_buf+j, "patches:");
+ j += sprintf(file_buf+j, "patches:");
for (int i = 0; pr->patches[i] != NULL; i++) {
- j += sprintf(info_buf+j, " %s", pr->patches[i]->name);
+ j += sprintf(file_buf+j, " %s", pr->patches[i]->name);
}
}
@@ -151,10 +151,10 @@ int create_info_file(pull_request *pr, const char *pr_root) {
/* Did we read the file? */
if (buf != NULL) {
/* Are the contents of the info file the same? */
- if (strcmp(info_buf, buf) == 0) {
+ if (strcmp(file_buf, buf) == 0) {
log(LOG_NOTICE, "New info file is the same as the existing one.");
free(filename);
- free(info_buf);
+ free(file_buf);
free(buf);
return 2;
}
@@ -174,7 +174,7 @@ int create_info_file(pull_request *pr, const char *pr_root) {
return 0;
}
- fwrite(info_buf, sizeof(char), buf_len, fp);
+ fwrite(file_buf, sizeof(char), buf_len, fp);
fclose(fp);
return 1;