From a8f375bede6c397ae99558df3265a0f603f3dfd5 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Fri, 25 Jun 2021 17:13:56 +0200 Subject: large refactor of checker, added more havocs to test listing and search, added motd to service welcome banner --- service/src/stlfile.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'service/src/stlfile.c') diff --git a/service/src/stlfile.c b/service/src/stlfile.c index 8a4ba9a..bddb24f 100644 --- a/service/src/stlfile.c +++ b/service/src/stlfile.c @@ -310,7 +310,7 @@ fail: } int -parse_file(struct parseinfo *info, char *buf, size_t len) +parse_file(struct parseinfo *info, char *buf, size_t len, char **modelname) { int status; const char *resp; @@ -332,17 +332,11 @@ parse_file(struct parseinfo *info, char *buf, size_t len) : parse_file_bin(info, buf, len); if (status == FAIL) return FAIL; - if (!info->modelname) { - resp = ask("Please enter your model name: "); - if (strlen(resp) < 4) { - ERR("Model name is too short!\n"); - return FAIL; - } - info->modelname = checkp(strdup(resp)); - } - if (!info->solidname) info->solidname = checkp(strdup("")); + info->modelname = *modelname; + *modelname = NULL; + info->hash = checkp(strdup(mhash(info->modelname, -1))); return OK; -- cgit v1.2.3-71-gd317