diff options
-rw-r--r-- | degesch.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -789,9 +789,9 @@ buffer_send (struct app_context *ctx, struct buffer *buffer, line->type = type; line->flags = flags; line->when = time (NULL); - line->who = xstrdup (origin); + line->who = origin ? xstrdup (origin) : NULL; line->object = str_steal (&text); - line->reason = xstrdup (reason); + line->reason = reason ? xstrdup (reason) : NULL; LIST_APPEND_WITH_TAIL (buffer->lines, buffer->lines_tail, line); buffer->lines_count++; @@ -804,6 +804,11 @@ buffer_send (struct app_context *ctx, struct buffer *buffer, buffer_line_display (ctx, line); } +#define buffer_send_status(ctx, buffer, ...) \ + buffer_send (ctx, buffer, BUFFER_LINE_STATUS, 0, NULL, NULL, __VA_ARGS__) +#define buffer_send_error(ctx, buffer, ...) \ + buffer_send (ctx, buffer, BUFFER_LINE_ERROR, 0, NULL, NULL, __VA_ARGS__) + static struct buffer * buffer_by_name (struct app_context *ctx, const char *name) { |