summaryrefslogtreecommitdiffstats
path: root/src/journal-remote/journal-upload-journal.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-01-27 14:00:11 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-02-01 23:21:39 +0100
commit5ffa8c818120e35c89becd938d160235c069dd12 (patch)
treee4a1ce20a003e23618bd54f49cb4acf68aed70cd /src/journal-remote/journal-upload-journal.c
parenttmpfiles: accurately report creation results (diff)
downloadsystemd-5ffa8c818120e35c89becd938d160235c069dd12.tar.xz
systemd-5ffa8c818120e35c89becd938d160235c069dd12.zip
Add a snprinf wrapper which checks that the buffer was big enough
If we scale our buffer to be wide enough for the format string, we should expect that the calculation was correct. char_array_0() invocations are removed, since snprintf nul-terminates the output in any case. A similar wrapper is used for strftime calls, but only in timedatectl.c.
Diffstat (limited to 'src/journal-remote/journal-upload-journal.c')
-rw-r--r--src/journal-remote/journal-upload-journal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journal-remote/journal-upload-journal.c b/src/journal-remote/journal-upload-journal.c
index 942320cbf6..5fd639a76a 100644
--- a/src/journal-remote/journal-upload-journal.c
+++ b/src/journal-remote/journal-upload-journal.c
@@ -104,7 +104,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
r = snprintf(buf + pos, size - pos,
"_BOOT_ID=%s\n", sd_id128_to_string(boot_id, sid));
- if (r + pos> size)
+ if (r + pos > size)
/* not enough space */
return pos;