X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fmain.c;fp=src%2Fcore%2Fmain.c;h=02b7c37f8dcd8d85c4326ccaf731dfbffdbaeade;hp=0df1f6423a8f09d191efca6d65a1794ebee7c314;hb=5ffa8c818120e35c89becd938d160235c069dd12;hpb=294929f8916ca37d89ccb1757868d22f8068c56b diff --git a/src/core/main.c b/src/core/main.c index 0df1f6423..02b7c37f8 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1883,7 +1883,7 @@ finish: args = newa(const char*, args_size); if (!switch_root_init) { - char sfd[16]; + char sfd[DECIMAL_STR_MAX(int) + 1]; /* First try to spawn ourselves with the right * path, and with full serialization. We do @@ -1893,8 +1893,7 @@ finish: assert(arg_serialization); assert(fds); - snprintf(sfd, sizeof(sfd), "%i", fileno(arg_serialization)); - char_array_0(sfd); + xsprintf(sfd, "%i", fileno(arg_serialization)); i = 0; args[i++] = SYSTEMD_BINARY_PATH; @@ -1995,7 +1994,7 @@ finish: assert(command_line[pos] == NULL); env_block = strv_copy(environ); - snprintf(log_level, sizeof(log_level), "%d", log_get_max_level()); + xsprintf(log_level, "%d", log_get_max_level()); switch (log_get_target()) { case LOG_TARGET_KMSG: