From c0913d90437752b9ad027c3c8c2fae66e6db72d0 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 27 Jun 2021 11:00:38 -0400 Subject: Renamed `info_buf` to `file_buf` in `create_info_file()`. --- git.c | 30 +++++++++++++++--------------- 1 file 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; -- cgit v1.2.3-13-gbd6f