~aperezdc/dmon

65565f9a098bddb7bb3a4536b2100f68d3fe0c15 — Adrian Perez de Castro 3 years ago 9e5aad6
d[r]log: Reduce size of iovec struct arrays

Now that the trailing newline character is present in the line buffers
and not added anymore as the last iovec entry, it is possible to reduce
the size of the arrays by one.
2 files changed, 2 insertions(+), 2 deletions(-)

M dlog.c
M drlog.c
M dlog.c => dlog.c +1 -1
@@ 120,7 120,7 @@ dlog_main (int argc, char **argv)
            die ("%s: error reading input: %s\n", argv0, ERRSTR);

        if (!skip_empty || dbuf_size(&linebuf) > 1) {
            struct iovec iov[6];
            struct iovec iov[5];
            int n_iov = 0;

            char timebuf[TSTAMP_LEN+1];

M drlog.c => drlog.c +1 -1
@@ 267,7 267,7 @@ recreate_ts:
        return;

    char timebuf[TSTAMP_LEN+1];
    struct iovec iov[3];
    struct iovec iov[2];
    int n_iov = 0;

    if (timestamp) {