X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fjournal-send.c;h=bc44828e1c0e0ea724d496d397d6fa6f5928e178;hb=95ea1b90cc61f464f3b9bc147119dee4ba9620b8;hp=32e94af91f15b9c989efc399ef47ef7935e30526;hpb=b070e7f3c9ed680c821bd89d42506695f2438506;p=elogind.git diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c index 32e94af91..bc44828e1 100644 --- a/src/journal/journal-send.c +++ b/src/journal/journal-send.c @@ -6,16 +6,16 @@ Copyright 2011 Lennart Poettering systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. systemd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see . ***/ @@ -97,7 +97,7 @@ _public_ int sd_journal_printv(int priority, const char *format, va_list ap) { } static int fill_iovec_sprintf(const char *format, va_list ap, int extra, struct iovec **_iov) { - int r, n = 0, i, j; + int r, n = 0, i = 0, j; struct iovec *iov = NULL; int saved_errno; @@ -113,8 +113,7 @@ static int fill_iovec_sprintf(const char *format, va_list ap, int extra, struct } i = extra; - } else - i = 0; + } while (format) { struct iovec *c; @@ -376,10 +375,11 @@ _public_ int sd_journal_stream_fd(const char *identifier, int priority, int leve identifier = ""; l = strlen(identifier); - header = alloca(l + 1 + 2 + 2 + 2 + 2 + 2); + header = alloca(l + 1 + 1 + 2 + 2 + 2 + 2 + 2); memcpy(header, identifier, l); header[l++] = '\n'; + header[l++] = '\n'; header[l++] = '0' + priority; header[l++] = '\n'; header[l++] = '0' + !!level_prefix;