X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Ffsck%2Ffsck.c;h=78ceeb6fab384e4bdbc3b234c866060a1383d041;hb=a38d99451f2bf8026ec51aee91662292e823c6a8;hp=20b794094835c0f5c3a988694ca1fb084fbd08cd;hpb=96aad8d15a324d0e956a4e5653a11a67b209b41a;p=elogind.git diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c index 20b794094..78ceeb6fa 100644 --- a/src/fsck/fsck.c +++ b/src/fsck/fsck.c @@ -222,7 +222,7 @@ int main(int argc, char *argv[]) { const char *device, *type; bool root_directory; int progress_pipe[2] = { -1, -1 }; - char dash_c[2+10+1]; + char dash_c[sizeof("-C")-1 + DECIMAL_STR_MAX(int) + 1]; struct stat st; if (argc > 2) { @@ -336,8 +336,7 @@ int main(int argc, char *argv[]) { cmdline[i++] = "-f"; if (progress_pipe[1] >= 0) { - snprintf(dash_c, sizeof(dash_c), "-C%i", progress_pipe[1]); - char_array_0(dash_c); + xsprintf(dash_c, "-C%i", progress_pipe[1]); cmdline[i++] = dash_c; }