Fossil

Check-in [9a8fdf72]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change the name of the strnlen_() function in printf.c to StrNLen32().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9a8fdf7294825aaf24f0e415c443c709ef6d1177
User & Date: drh 2009-12-18 21:38:19
Context
2009-12-18
22:01
Change the name of the "anon-login-enable-captcha-filler" setting to "auto-captcha". Move the GUI setting of this setting over to the "Setup/Behavior" page. check-in: fe019f94 user: drh tags: trunk
21:38
Change the name of the strnlen_() function in printf.c to StrNLen32(). check-in: 9a8fdf72 user: drh tags: trunk
20:15
Add an "annotate" command to the command-line to suppliment the "annotate" web page. check-in: 73b7faa5 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/printf.c.

151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
...
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
...
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596

/*
** Find the length of a string as long as that length does not
** 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){
  int n = 0;
  while( (N-- != 0) && *(z++)!=0 ){ n++; }
  return n;
}


/*
................................................................................
        bufpt = buf;
        break;
      case etPATH: {
        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);
        zExtra = bufpt = malloc(length+1);
        for( i=0; i<length; i++ ){
          if( e[i]=='\\' ){
            bufpt[i]='/';
          }else{
            bufpt[i]=e[i];
          }
................................................................................
        int limit = flag_alternateform ? va_arg(ap,int) : -1;
        bufpt = va_arg(ap,char*);
        if( bufpt==0 ){
          bufpt = "";
        }else if( xtype==etDYNSTRING ){
          zExtra = bufpt;
        }
        length = strnlen_(bufpt, limit);
        if( precision>=0 && precision<length ) length = precision;
        break;
      }
      case etBLOB: {
        int limit = flag_alternateform ? va_arg(ap, int) : -1;
        Blob *pBlob = va_arg(ap, Blob*);
        bufpt = blob_buffer(pBlob);







|







 







|







 







|







151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
...
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
...
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596

/*
** Find the length of a string as long as that length does not
** 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 StrNLen32(const char *z, int N){
  int n = 0;
  while( (N-- != 0) && *(z++)!=0 ){ n++; }
  return n;
}


/*
................................................................................
        bufpt = buf;
        break;
      case etPATH: {
        int i;
        int limit = flag_alternateform ? va_arg(ap,int) : -1;
        char *e = va_arg(ap,char*);
        if( e==0 ){e="";}
        length = StrNLen32(e, limit);
        zExtra = bufpt = malloc(length+1);
        for( i=0; i<length; i++ ){
          if( e[i]=='\\' ){
            bufpt[i]='/';
          }else{
            bufpt[i]=e[i];
          }
................................................................................
        int limit = flag_alternateform ? va_arg(ap,int) : -1;
        bufpt = va_arg(ap,char*);
        if( bufpt==0 ){
          bufpt = "";
        }else if( xtype==etDYNSTRING ){
          zExtra = bufpt;
        }
        length = StrNLen32(bufpt, limit);
        if( precision>=0 && precision<length ) length = precision;
        break;
      }
      case etBLOB: {
        int limit = flag_alternateform ? va_arg(ap, int) : -1;
        Blob *pBlob = va_arg(ap, Blob*);
        bufpt = blob_buffer(pBlob);