diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-07-18 18:34:54 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-07-18 18:34:54 +0300 |
commit | f6657a46e2422d903d62565868f77c430a612a42 (patch) | |
tree | b70b4f45003e067de55a8ac425792c98fd06035d /src/report.c | |
parent | 3a16bc5620b4c664248bc5b5c586ddd0103f7050 (diff) | |
download | wydawca-f6657a46e2422d903d62565868f77c430a612a42.tar.gz wydawca-f6657a46e2422d903d62565868f77c430a612a42.tar.bz2 |
Fix unnecessary code duplication
Use grecs_txtacc.
Diffstat (limited to 'src/report.c')
-rw-r--r-- | src/report.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/report.c b/src/report.c index e1a108d..c24fe33 100644 --- a/src/report.c +++ b/src/report.c @@ -17,16 +17,16 @@ #include "wydawca.h" -static struct txtacc *report_acc; +static struct grecs_txtacc *report_acc; char *report_string; void report_init() { if (!report_acc) - report_acc = txtacc_create(); + report_acc = grecs_txtacc_create(); else - txtacc_free_string(report_acc, report_string); + grecs_txtacc_free_string(report_acc, report_string); } void @@ -40,8 +40,8 @@ report_add(const char *fmt, ...) grecs_vasprintf(&str, &size, fmt, ap); va_end(ap); if (str) { - txtacc_grow(report_acc, str, strlen(str)); - txtacc_1grow(report_acc, '\n'); + grecs_txtacc_grow_string(report_acc, str); + grecs_txtacc_grow_char(report_acc, '\n'); } free(str); } @@ -49,6 +49,6 @@ report_add(const char *fmt, ...) void report_finish() { - txtacc_1grow(report_acc, 0); - report_string = txtacc_finish(report_acc, 0); + grecs_txtacc_grow_char(report_acc, 0); + report_string = grecs_txtacc_finish(report_acc, 0); } |