** Decode the LFH record in buffer aBuf into (*pLFH). Return SQLITE_ERROR ** if the record is not well-formed, or SQLITE_OK otherwise. */
| 6504 | ** if the record is not well-formed, or SQLITE_OK otherwise. |
| 6505 | */ |
| 6506 | static int zipfileReadLFH( |
| 6507 | u8 *aBuffer, |
| 6508 | ZipfileLFH *pLFH |
| 6509 | ){ |
| 6510 | u8 *aRead = aBuffer; |
| 6511 | int rc = SQLITE_OK; |
| 6512 | |
| 6513 | u32 sig = zipfileRead32(aRead); |
| 6514 | if( sig!=ZIPFILE_SIGNATURE_LFH ){ |
| 6515 | rc = SQLITE_ERROR; |
| 6516 | }else{ |
| 6517 | pLFH->iVersionExtract = zipfileRead16(aRead); |
| 6518 | pLFH->flags = zipfileRead16(aRead); |
| 6519 | pLFH->iCompression = zipfileRead16(aRead); |
| 6520 | pLFH->mTime = zipfileRead16(aRead); |
| 6521 | pLFH->mDate = zipfileRead16(aRead); |
| 6522 | pLFH->crc32 = zipfileRead32(aRead); |
| 6523 | pLFH->szCompressed = zipfileRead32(aRead); |
| 6524 | pLFH->szUncompressed = zipfileRead32(aRead); |
| 6525 | pLFH->nFile = zipfileRead16(aRead); |
| 6526 | pLFH->nExtra = zipfileRead16(aRead); |
| 6527 | } |
| 6528 | return rc; |
| 6529 | } |
| 6530 | |
| 6531 | |
| 6532 | /* |