From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 73CF4385DC02; Tue, 29 Mar 2022 20:33:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 73CF4385DC02 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] elf: Fix wrong fscanf usage on tst-pldd X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: bd89293b9ee841728c72492bf6bbc9a92fc0876c X-Git-Newrev: 980f5969344116bd0ba3e46c9359e6112e77f444 Message-Id: <20220329203339.73CF4385DC02@sourceware.org> Date: Tue, 29 Mar 2022 20:33:39 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2022 20:33:39 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=980f5969344116bd0ba3e46c9359e6112e77f444 commit 980f5969344116bd0ba3e46c9359e6112e77f444 Author: Adhemerval Zanella Date: Fri Mar 25 11:16:49 2022 -0300 elf: Fix wrong fscanf usage on tst-pldd To take in consideration the extra '\0'. Checked on x86_64-linux-gnu. Diff: --- elf/tst-pldd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 : */ - 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);