[PATCH] manual: Fixed typo in manual/stdio.texi [BZ #24638]

Girish Joshi girish946@gmail.com
Mon Mar 9 12:35:27 GMT 2020


On Mon, Mar 9, 2020 at 5:58 PM Florian Weimer <fw@deneb.enyo.de> wrote:
>
> * Girish Joshi:
>
> >    /* @r{Check the C type wanted for each argument}
> >       @r{and see if the object given is suitable.}  */
> > +  int i;
> >    for (i = 0; i < nwanted; i++)
>
> Please move the declaration of i into the for statement or to the
> start of the function.

My bad. Corrected that.

>From b1b57db94504879d5249bace204a03917869b50e Mon Sep 17 00:00:00 2001
From: Girish Joshi <girish946@gmail.com>
Date: Mon, 9 Mar 2020 17:04:27 +0530
Subject: [PATCH] manual: Fix example for parse_printf_format in stdio.texi.

Added the missing declaration of variable i and argument list
for error () function corrected.
---
 manual/stdio.texi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/manual/stdio.texi b/manual/stdio.texi
index c48e3e692f..ada425c3c1 100644
--- a/manual/stdio.texi
+++ b/manual/stdio.texi
@@ -2873,6 +2873,7 @@ validate_args (char *format, int nargs, OBJECT *args)
 @{
   int *argtypes;
   int nwanted;
+  int i;

   /* @r{Get the information about the arguments.}
      @r{Each conversion specification must be at least two characters}
@@ -2885,7 +2886,7 @@ validate_args (char *format, int nargs, OBJECT *args)
   /* @r{Check the number of arguments.}  */
   if (nwanted > nargs)
     @{
-      error ("too few arguments (at least %d required)", nwanted);
+      error (0, 0, "too few arguments (at least %d required)", nwanted);
       return 0;
     @}

@@ -2917,7 +2918,7 @@ validate_args (char *format, int nargs, OBJECT *args)
       @}
       if (TYPE (args[i]) != wanted)
     @{
-      error ("type mismatch for arg number %d", i);
+      error (0, 0, "type mismatch for arg number %d", i);
       return 0;
     @}
     @}
-- 
2.21.1

Girish Joshi


More information about the Libc-alpha mailing list