chiark / gitweb /
Add a snprinf wrapper which checks that the buffer was big enough
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 27 Jan 2015 13:00:11 +0000 (08:00 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 1 Feb 2015 22:21:39 +0000 (17:21 -0500)
commit5ffa8c818120e35c89becd938d160235c069dd12
treee4a1ce20a003e23618bd54f49cb4acf68aed70cd
parent294929f8916ca37d89ccb1757868d22f8068c56b
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.
23 files changed:
src/core/automount.c
src/core/job.c
src/core/main.c
src/core/selinux-access.c
src/core/unit.c
src/fsck/fsck.c
src/journal-remote/journal-remote.c
src/journal-remote/journal-upload-journal.c
src/journal/journal-send.c
src/journal/journald-console.c
src/journal/journald-kmsg.c
src/journal/journald-server.c
src/journal/journald-stream.c
src/journal/journald-syslog.c
src/journal/sd-journal.c
src/libsystemd-terminal/subterm.c
src/libsystemd/sd-bus/bus-control.c
src/libsystemd/sd-bus/bus-socket.c
src/shared/log.c
src/shared/spawn-polkit-agent.c
src/shared/switch-root.c
src/shared/util.h
src/timedate/timedatectl.c