c641a2
commit b2cd93fce666fdc8c9a5c64af2741a8a6940ac99
c641a2
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
c641a2
Date:   Fri Mar 25 11:16:49 2022 -0300
c641a2
c641a2
    elf: Fix wrong fscanf usage on tst-pldd
c641a2
    
c641a2
    To take in consideration the extra '\0'.
c641a2
    
c641a2
    Checked on x86_64-linux-gnu.
c641a2
c641a2
diff --git a/elf/tst-pldd.c b/elf/tst-pldd.c
c641a2
index 45ac033a0f897088..ab89798e250fdccc 100644
c641a2
--- a/elf/tst-pldd.c
c641a2
+++ b/elf/tst-pldd.c
c641a2
@@ -115,7 +115,8 @@ do_test (void)
c641a2
     TEST_VERIFY (out != NULL);
c641a2
 
c641a2
     /* First line is in the form of <pid>: <full path of executable>  */
c641a2
-    TEST_COMPARE (fscanf (out, "%u: " STRINPUT (512), &pid, buffer), 2);
c641a2
+    TEST_COMPARE (fscanf (out, "%u: " STRINPUT (sizeof (buffer) - 1), &pid,
c641a2
+			  buffer), 2);
c641a2
 
c641a2
     TEST_COMPARE (pid, *target_pid_ptr);
c641a2
     TEST_COMPARE (strcmp (basename (buffer), "tst-pldd"), 0);