fix the bug of content based read offset

This commit is contained in:
lion 2022-06-28 18:37:02 +08:00
parent fd00e567af
commit be811e787e
1 changed files with 1 additions and 1 deletions

View File

@ -147,7 +147,7 @@ XDB_PUBLIC(int) xdb_search(xdb_searcher_t *xdb, unsigned int ip, char *region_bu
XDB_PRIVATE(int) read(xdb_searcher_t *xdb, long offset, char *buffer, size_t length) { XDB_PRIVATE(int) read(xdb_searcher_t *xdb, long offset, char *buffer, size_t length) {
// check the xdb content cache first // check the xdb content cache first
if (xdb->content_buff != NULL) { if (xdb->content_buff != NULL) {
memcpy(buffer, xdb->content_buff, length); memcpy(buffer, xdb->content_buff + offset, length);
return 0; return 0;
} }