1
0
mirror of https://github.com/fumiama/simple-dict.git synced 2026-06-08 12:00:24 +08:00

add docker

This commit is contained in:
fumiama
2021-12-13 17:28:29 +08:00
parent 2036edccf5
commit 3fca017aea
5 changed files with 153 additions and 14 deletions

9
dict.c
View File

@@ -1,7 +1,7 @@
#include <stdio.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <simplemd5.h>
#include <simplecrypto.h>
#include "dict.h"
#include "server.h"
@@ -21,6 +21,13 @@ static FILE* thread_fp[THREADCNT];
int fill_md5() {
size_t size = get_dict_size();
if(!size) {
if(dict_md5) free(dict_md5);
dict_md5 = malloc(16);
memset(dict_md5, 0, 16);
puts("Dict is empty, use all zero md5");
return 1;
}
uint8_t* dict_buff = (uint8_t*)malloc(size);
if(dict_buff) {
rewind(fp5);