mirror of
				https://github.com/sqlite/sqlite.git
				synced 2025-11-03 16:53:36 +03:00 
			
		
		
		
	mprintf() correctly handles "%s","". Fix for ticket #812. (CVS 1800)
FossilOrigin-Name: 4f56db1149f65dc2edf6626fa20ae255a5f5280c
This commit is contained in:
		@@ -228,6 +228,7 @@ static int vxprintf(
 | 
			
		||||
  int nsd;                   /* Number of significant digits returned */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  func(arg,"",0);
 | 
			
		||||
  count = length = 0;
 | 
			
		||||
  bufpt = 0;
 | 
			
		||||
  for(; (c=(*fmt))!=0; ++fmt){
 | 
			
		||||
@@ -684,9 +685,11 @@ static void mout(void *arg, const char *zNewText, int nNewChar){
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  if( pM->zText && nNewChar>0 ){
 | 
			
		||||
    memcpy(&pM->zText[pM->nChar], zNewText, nNewChar);
 | 
			
		||||
    pM->nChar += nNewChar;
 | 
			
		||||
  if( pM->zText ){
 | 
			
		||||
    if( nNewChar>0 ){
 | 
			
		||||
      memcpy(&pM->zText[pM->nChar], zNewText, nNewChar);
 | 
			
		||||
      pM->nChar += nNewChar;
 | 
			
		||||
    }
 | 
			
		||||
    pM->zText[pM->nChar] = 0;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user