1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Do not assume that a pointer can fit in a long inside the printf() code.

Ticket #342. (CVS 1013)

FossilOrigin-Name: 5dad7c05e9789e101d5ce75a6f3ea2ffb278b29d
This commit is contained in:
drh
2003-06-07 11:29:50 +00:00
parent 048aa234ef
commit 94ce4c1e3b
3 changed files with 11 additions and 11 deletions

View File

@ -389,7 +389,7 @@ static int vxprintf(
longvalue = longvalue/base;
}while( longvalue>0 );
}
length = (long)&buf[etBUFSIZE]-(long)bufpt;
length = &buf[etBUFSIZE]-bufpt;
for(idx=precision-length; idx>0; idx--){
*(--bufpt) = '0'; /* Zero pad */
}
@ -401,7 +401,7 @@ static int vxprintf(
for(pre=infop->prefix; (x=(*pre))!=0; pre++) *(--bufpt) = x;
}
}
length = (long)&buf[etBUFSIZE]-(long)bufpt;
length = &buf[etBUFSIZE]-bufpt;
break;
case etFLOAT:
case etEXP:
@ -511,7 +511,7 @@ static int vxprintf(
/* The converted number is in buf[] and zero terminated. Output it.
** Note that the number is in the usual order, not reversed as with
** integer conversions. */
length = (long)bufpt-(long)buf;
length = bufpt-buf;
bufpt = buf;
/* Special case: Add leading zeros if the flag_zeropad flag is