diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-03-25 11:16:49 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-03-31 08:57:59 -0300 |
commit | b2cd93fce666fdc8c9a5c64af2741a8a6940ac99 (patch) | |
tree | f61d6bb8af59c8b1f272a7b663e67640a03b5ce5 | |
parent | f902892aaf92295a7d3065370412fb51a13e13e9 (diff) | |
download | glibc-b2cd93fce666fdc8c9a5c64af2741a8a6940ac99.tar.gz glibc-b2cd93fce666fdc8c9a5c64af2741a8a6940ac99.tar.xz glibc-b2cd93fce666fdc8c9a5c64af2741a8a6940ac99.zip |
elf: Fix wrong fscanf usage on tst-pldd
To take in consideration the extra '\0'. Checked on x86_64-linux-gnu.
-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 f31f9956fa..8916ce5a2e 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); |