We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8184063 commit bf15c15Copy full SHA for bf15c15
src/libduc/db.c
@@ -117,8 +117,9 @@ char *duc_db_type_check(const char *path_db)
117
/* read first MAGIC_LEN bytes of file then look for the strings, etc for each type of DB we support. */
118
size_t len = fread(buf, 1, sizeof(buf),f);
119
120
- if (strncmp(buf,"Kyoto CaBiNeT",13) == 0) {
121
- return("kyotocabinet");
+ char kyotocabinet[] = { 0x4b,0x43,0x0a,0x0,0x10,0x0e,0x06,0xb4,0x31,0x08,0x0a,0x04,0x00,0x00,0x00,0x00 };
+ if (memcmp(buf,kyotocabinet,16) == 0) {
122
+ return("kyotocabinet(hex)");
123
}
124
125
if (strncmp(buf,"ToKyO CaBiNeT",13) == 0) {
@@ -133,7 +134,9 @@ char *duc_db_type_check(const char *path_db)
133
134
return("sqlite3");
135
136
- if (strncmp(buf,"SQLite format 3",15) == 0) {
137
+ char lmdb[] = { 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x08,0x0,0x0,0x0,0x0,0x0,
138
+ 0xde,0xc0,0xef,0xbe,0x01,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 };
139
+ if (memcmp(buf,lmdb,32) == 0) {
140
return("lmdb");
141
142
0 commit comments