172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
+
|
{ 'G', 0, 1, etGENERIC, 14, 0 },
{ 'i', 10, 1, etRADIX, 0, 0 },
{ 'n', 0, 0, etSIZE, 0, 0 },
{ '%', 0, 0, etPERCENT, 0, 0 },
{ 'p', 16, 0, etPOINTER, 0, 1 },
{ '/', 0, 0, etPATH, 0, 0 },
{ '$', 0, 0, etSHELLESC, 0, 0 },
{ etERROR, 0,0,0,0,0} /* Must be last */
};
#define etNINFO count(fmtinfo)
/*
** Verify that the fmtchr[] and fmtinfo[] arrays are in agreement.
**
** This routine is a defense against programming errors.
|
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
|
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
|
-
+
-
-
-
+
+
+
+
+
-
-
+
|
int nsd; /* Number of significant digits returned */
char *zFmtLookup;
count = length = 0;
bufpt = 0;
for(; (c=(*fmt))!=0; ++fmt){
if( c!='%' ){
int amt;
bufpt = (char *)fmt;
#if HAVE_STRCHRNUL
amt = 1;
while( (c=(*++fmt))!='%' && c!=0 ) amt++;
blob_append(pBlob,bufpt,amt);
fmt = strchrnul(fmt, '%');
#else
do{ fmt++; }while( *fmt && *fmt != '%' );
#endif
blob_append(pBlob, bufpt, (int)(fmt - bufpt));
count += amt;
if( c==0 ) break;
if( *fmt==0 ) break;
}
if( (c=(*++fmt))==0 ){
errorflag = 1;
blob_append(pBlob,"%",1);
count++;
break;
}
|