Diff
Not logged in

Differences From:

File src/printf.c part of check-in [8c3ec00311] - On the printf extension converters (ex: %T, %w) the "alternate form flag" (ex: %#T, %#w) means first read an integer from the argument list and then only process that number of characters from the string or blob that is read next from the argument list. by drh on 2008-02-04 19:07:58. [view]

To:

File src/printf.c part of check-in [0c78ba2eb4] - s/strnlen/strnlen_/g for the local strnlen impementation because the name fataly collides with a func from standard headers in some gcc versions (e.g. GnuSolaris/Nexenta w/ gcc 4.0.x). by stephan on 2008-04-25 21:45:41. [view]

@@ -154,9 +154,9 @@
 ** exceed N bytes.  If no zero terminator is seen in the first
 ** N bytes then return N.  If N is negative, then this routine
 ** is an alias for strlen().
 */
-static int strnlen(const char *z, int N){
+static int strnlen_(const char *z, int N){
   int n = 0;
   while( (N-- != 0) && *(z++)!=0 ){ n++; }
   return n;
 }
@@ -564,9 +564,9 @@
         int i;
         int limit = flag_alternateform ? va_arg(ap,int) : -1;
         char *e = va_arg(ap,char*);
         if( e==0 ){e="";}
-        length = strnlen(e, limit);
+        length = strnlen_(e, limit);
         zExtra = bufpt = malloc(length+1);
         for( i=0; i<length; i++ ){
           if( e[i]=='\\' ){
             bufpt[i]='/';
@@ -585,9 +585,9 @@
           bufpt = "";
         }else if( xtype==etDYNSTRING ){
           zExtra = bufpt;
         }
-        length = strnlen(bufpt, limit);
+        length = strnlen_(bufpt, limit);
         if( precision>=0 && precision<length ) length = precision;
         break;
       }
       case etBLOB: {