X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2Fsqlite%2Fsrc%2Fsrc%2Frecover.c;h=c996d536b4735be1ee9ed531896094746c7de034;hb=3545e9f2671f595d2a2f3ee75ca0393b01e35ef6;hp=097c92019ea238a07106f5db3af87ce12755e339;hpb=7d210d4c7e9ba36e635eabc5b5780495f8a63292;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/sqlite/src/src/recover.c b/src/third_party/sqlite/src/src/recover.c index 097c920..c996d53 100644 --- a/src/third_party/sqlite/src/src/recover.c +++ b/src/third_party/sqlite/src/src/recover.c @@ -643,6 +643,8 @@ static void interiorCursorDestroy(RecoverInteriorCursor *pCursor){ /* Internal helper. Reset storage in preparation for iterating pPage. */ static void interiorCursorSetPage(RecoverInteriorCursor *pCursor, DbPage *pPage){ + const unsigned knMinCellLength = 2 + 4 + 1; + unsigned nMaxChildren; assert( PageHeader(pPage)[kiPageTypeOffset]==kTableInteriorPage ); if( pCursor->pPage ){ @@ -669,8 +671,7 @@ static void interiorCursorSetPage(RecoverInteriorCursor *pCursor, * byte is corrupted. Could be an overflow page, but it would require * a very large database. */ - const unsigned knMinCellLength = 2 + 4 + 1; - unsigned nMaxChildren = + nMaxChildren = (pCursor->nPageSize - kiPageInteriorHeaderBytes) / knMinCellLength + 1; if (pCursor->nChildren > nMaxChildren) { pCursor->nChildren = nMaxChildren;