aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-03-25 11:16:49 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-03-31 08:57:59 -0300
commitb2cd93fce666fdc8c9a5c64af2741a8a6940ac99 (patch)
treef61d6bb8af59c8b1f272a7b663e67640a03b5ce5 /elf
parentf902892aaf92295a7d3065370412fb51a13e13e9 (diff)
downloadglibc-b2cd93fce666fdc8c9a5c64af2741a8a6940ac99.zip
glibc-b2cd93fce666fdc8c9a5c64af2741a8a6940ac99.tar.gz
glibc-b2cd93fce666fdc8c9a5c64af2741a8a6940ac99.tar.bz2
elf: Fix wrong fscanf usage on tst-pldd
To take in consideration the extra '\0'. Checked on x86_64-linux-gnu.
Diffstat (limited to 'elf')
-rw-r--r--elf/tst-pldd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/elf/tst-pldd.c b/elf/tst-pldd.c
index f31f995..8916ce5 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);