/ Check-in [cbe32216]
Login

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

Overview
Comment:Try to work around a bug in VC++ by only passing unsigned characters to the isspace() routine. Bug reported on the mailing list. (CVS 1087)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cbe32216966c987902ceb4d85332fc95801dbda2
User & Date: drh 2003-08-26 11:35:00
Context
2003-08-26
11:41
Fix compiler warnings under OpenVMS. Ticket #357. (CVS 1088) check-in: c95f347c user: drh tags: trunk
11:35
Try to work around a bug in VC++ by only passing unsigned characters to the isspace() routine. Bug reported on the mailing list. (CVS 1087) check-in: cbe32216 user: drh tags: trunk
11:29
Fix a bug in sqliteRealloc() that only occurs if there is memory corruption and debugging is enabled. Ticket #421. (CVS 1086) check-in: eebc82b7 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

    32     32   **
    33     33   ** Various scripts scan this source file in order to generate HTML
    34     34   ** documentation, headers files, or other derived files.  The formatting
    35     35   ** of the code in this file is, therefore, important.  See other comments
    36     36   ** in this file for details.  If in doubt, do not deviate from existing
    37     37   ** commenting and indentation practices when changing or adding code.
    38     38   **
    39         -** $Id: vdbe.c,v 1.236 2003/08/16 12:37:52 drh Exp $
           39  +** $Id: vdbe.c,v 1.237 2003/08/26 11:35:00 drh Exp $
    40     40   */
    41     41   #include "sqliteInt.h"
    42     42   #include "os.h"
    43     43   #include <ctype.h>
    44     44   
    45     45   /*
    46     46   ** The makefile scans this source file and creates the following
................................................................................
   578    578   
   579    579   /*
   580    580   ** On the P3 argument of the given instruction, change all
   581    581   ** strings of whitespace characters into a single space and
   582    582   ** delete leading and trailing whitespace.
   583    583   */
   584    584   void sqliteVdbeCompressSpace(Vdbe *p, int addr){
   585         -  char *z;
          585  +  unsigned char *z;
   586    586     int i, j;
   587    587     Op *pOp;
   588    588     assert( p->magic==VDBE_MAGIC_INIT );
   589    589     if( p->aOp==0 || addr<0 || addr>=p->nOp ) return;
   590    590     pOp = &p->aOp[addr];
   591    591     if( pOp->p3type==P3_POINTER ){
   592    592       return;
   593    593     }
   594    594     if( pOp->p3type!=P3_DYNAMIC ){
   595    595       pOp->p3 = sqliteStrDup(pOp->p3);
   596    596       pOp->p3type = P3_DYNAMIC;
   597    597     }
   598         -  z = pOp->p3;
          598  +  z = (unsigned char*)pOp->p3;
   599    599     if( z==0 ) return;
   600    600     i = j = 0;
   601    601     while( isspace(z[i]) ){ i++; }
   602    602     while( z[i] ){
   603    603       if( isspace(z[i]) ){
   604    604         z[j++] = ' ';
   605    605         while( isspace(z[++i]) ){}