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 --- src/stlfile.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/stlfile.c') diff --git a/src/stlfile.c b/src/stlfile.c index 953b5d7..17b97fc 100644 --- a/src/stlfile.c +++ b/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; @@ -333,17 +333,12 @@ 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("")); + /* transfer ownership */ + info->modelname = *modelname; + *modelname = NULL; + info->hash = checkp(strdup(mhash(info->modelname, -1))); return OK; -- cgit v1.2.3-71-gd317