From d054f0a4d451120c26494263fc4dc175bfd405b1 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Tue, 12 Jan 2016 15:34:20 +0100 Subject: tree-wide: use xsprintf() where applicable Also add a coccinelle receipt to help with such transitions. --- src/login/logind-seat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/login') diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c index 1f4936cebe..9d111f737c 100644 --- a/src/login/logind-seat.c +++ b/src/login/logind-seat.c @@ -34,6 +34,7 @@ #include "logind-seat.h" #include "mkdir.h" #include "parse-util.h" +#include "stdio-util.h" #include "string-util.h" #include "terminal-util.h" #include "util.h" @@ -181,7 +182,7 @@ static int vt_allocate(unsigned int vtnr) { assert(vtnr >= 1); - snprintf(p, sizeof(p), "/dev/tty%u", vtnr); + xsprintf(p, "/dev/tty%u", vtnr); fd = open_terminal(p, O_RDWR|O_NOCTTY|O_CLOEXEC); if (fd < 0) return -errno; -- cgit v1.2.3-54-g00ecf