bug-gnu-pspp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PSPP-BUG: [bug #62251] Strings containing „%.*s” cannot be reordered


From: Ben Pfaff
Subject: PSPP-BUG: [bug #62251] Strings containing „%.*s” cannot be reordered
Date: Mon, 4 Apr 2022 11:28:06 -0400 (EDT)

Update of bug #62251 (project pspp):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

When the conversion string has a "*", each "*" needs to have a numbered
position as well.  The manpage for printf explains it this way:


       The overall syntax of a conversion specification is:

           %[$][flags][width][.precision][length modifier]conversion

       The arguments must correspond properly (after type promotion) with the
conver‐
       sion specifier.  By default, the arguments are used in the order given,
 where
       each  '*'  (see Field width and Precision below) and each conversion
specifier
       asks for the next argument (and it is an error if  insufficiently  many
 argu‐
       ments are given).  One can also specify explicitly which argument is
taken, at
       each place where an argument is required, by writing "%m$" instead of
'%'  and
       "*m$"  instead of '*', where the decimal integer m denotes the position
in the
       argument list of the desired argument, indexed starting from 1.  Thus,

           printf("%*d", width, num);

       and

           printf("%2$*1$d", width, num);



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62251>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]