diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-03-25 11:16:49 -0300 |
---|---|---|
committer | Arjun Shankar <arjun@redhat.com> | 2022-11-25 14:17:56 +0100 |
commit | 309c4708aca762f57263a66e5bea926fdbfd82eb (patch) | |
tree | bb98a64ed81a6fcb24b752b0dc216eee6e33ef69 | |
parent | e3255e7d2188d1731aad83ad0dc147513560aa1e (diff) | |
download | glibc-309c4708aca762f57263a66e5bea926fdbfd82eb.tar glibc-309c4708aca762f57263a66e5bea926fdbfd82eb.tar.gz glibc-309c4708aca762f57263a66e5bea926fdbfd82eb.tar.bz2 glibc-309c4708aca762f57263a66e5bea926fdbfd82eb.zip |
elf: Fix wrong fscanf usage on tst-pldd
To take in consideration the extra '\0'.
Checked on x86_64-linux-gnu.
(cherry picked from commit b2cd93fce666fdc8c9a5c64af2741a8a6940ac99)
-rw-r--r-- | elf/tst-pldd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/elf/tst-pldd.c b/elf/tst-pldd.c index 210ca4d24b..72b7a99b36 100644 --- a/elf/tst-pldd.c +++ b/elf/tst-pldd.c @@ -113,7 +113,8 @@ do_test (void) TEST_VERIFY (out != NULL); /* First line is in the form of <pid>: <full path of executable> */ - TEST_COMPARE (fscanf (out, "%u: " STRINPUT (512), &pid, buffer), 2); + TEST_COMPARE (fscanf (out, "%u: " STRINPUT (sizeof (buffer) - 1), &pid, + buffer), 2); TEST_COMPARE (pid, *target_pid_ptr); TEST_COMPARE (strcmp (basename (buffer), "tst-pldd"), 0); |