]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sfdisk: use xstrcpy()
authorKarel Zak <kzak@redhat.com>
Mon, 20 May 2019 10:42:43 +0000 (12:42 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 20 May 2019 10:42:43 +0000 (12:42 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/sfdisk.c

index 83f3cf8f7afb337b4342b0def212036d5c02c18f..5e2d9adf7646e3a53dfaed15ee540f17729ecd56 100644 (file)
@@ -133,7 +133,7 @@ static int get_user_reply(const char *prompt, char *buf, size_t bufsz)
                p = readline(prompt);
                if (!p)
                        return 1;
-               strncpy(buf, p, bufsz - 1);
+               xstrncpy(buf, p, bufsz);
                free(p);
        } else
 #endif