httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/strings apr_snprintf.c
Date Thu, 02 Nov 2000 00:14:34 GMT
gstein      00/11/01 16:14:34

  Modified:    src/lib/apr/strings apr_snprintf.c
  Log:
  don't print anything for "%n"
  
  Submitted by: Karl Fogel <kfogel@collab.net<
  Message-ID: <200010302044.e9UKiuj09461@galois.collab.net>
  Reviewed by: Greg Stein
  
  Revision  Changes    Path
  1.7       +8 -4      apache-2.0/src/lib/apr/strings/apr_snprintf.c
  
  Index: apr_snprintf.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/strings/apr_snprintf.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- apr_snprintf.c	2000/10/16 06:04:48	1.6
  +++ apr_snprintf.c	2000/11/02 00:14:34	1.7
  @@ -708,6 +708,7 @@
   	    /*
   	     * Default variable settings
   	     */
  +            boolean_e print_something = YES;
   	    adjust = RIGHT;
   	    alternate_form = print_sign = print_blank = NO;
   	    pad_char = ' ';
  @@ -1000,6 +1001,7 @@
   		    *(va_arg(ap, short *)) = cc;
   		else
   		    *(va_arg(ap, int *)) = cc;
  +                print_something = NO;
   		break;
   
   		/*
  @@ -1131,10 +1133,12 @@
   	    /*
   	     * Print the string s. 
   	     */
  -	    for (i = s_len; i != 0; i--) {
  -		INS_CHAR(*s, sp, bep, cc);
  -		s++;
  -	    }
  +            if (print_something == YES) {
  +                for (i = s_len; i != 0; i--) {
  +  		    INS_CHAR(*s, sp, bep, cc);
  +		    s++;
  +                }
  +            }
   
   	    if (adjust_width && adjust == LEFT && min_width > s_len)
   		PAD(min_width, s_len, pad_char);
  
  
  

Mime
View raw message