aboutsummaryrefslogtreecommitdiff
path: root/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'format.c')
-rw-r--r--format.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/format.c b/format.c
index cea338a1..fcb0d801 100644
--- a/format.c
+++ b/format.c
@@ -191,8 +191,8 @@ static const char *format_lower[] = {
static void
format_job_update(struct job *job)
{
- struct format_job *fj = job->data;
- struct evbuffer *evb = job->event->input;
+ struct format_job *fj = job_get_data(job);
+ struct evbuffer *evb = job_get_event(job)->input;
char *line = NULL, *next;
time_t t;
@@ -221,18 +221,19 @@ format_job_update(struct job *job)
static void
format_job_complete(struct job *job)
{
- struct format_job *fj = job->data;
+ struct format_job *fj = job_get_data(job);
+ struct evbuffer *evb = job_get_event(job)->input;
char *line, *buf;
size_t len;
fj->job = NULL;
buf = NULL;
- if ((line = evbuffer_readline(job->event->input)) == NULL) {
- len = EVBUFFER_LENGTH(job->event->input);
+ if ((line = evbuffer_readline(evb)) == NULL) {
+ len = EVBUFFER_LENGTH(evb);
buf = xmalloc(len + 1);
if (len != 0)
- memcpy(buf, EVBUFFER_DATA(job->event->input), len);
+ memcpy(buf, EVBUFFER_DATA(evb), len);
buf[len] = '\0';
} else
buf = line;