fix memory leak and add framework test

This commit is contained in:
liuwentan
2022-11-29 14:12:40 +08:00
parent 7e6d131c9e
commit 84a271144b
19 changed files with 321 additions and 56 deletions

View File

@@ -178,4 +178,12 @@ char *str_unescape(char *s)
}
s[j] = '\0';
return s;
}
#define MAX_SYSTEM_CMD_LEN 512
int system_cmd_mkdir(const char *path)
{
char cmd[MAX_SYSTEM_CMD_LEN] = {0};
snprintf(cmd, sizeof(cmd), "mkdir -p %s", path);
return system(cmd);
}