From a501ef438acfb88bf822ea12e1fdd586e8e1baaf Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Thu, 8 Jul 2021 16:38:54 +0200 Subject: use usual random ids for modelname and solidname in havoc 15, various smaller fixes --- src/stlfile.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/stlfile.c b/src/stlfile.c index 1a963f1..9040238 100644 --- a/src/stlfile.c +++ b/src/stlfile.c @@ -270,8 +270,7 @@ parse_file_bin(struct parseinfo *info, char *buf, size_t len) memcpy(info->header, buf, 80); - if (*buf == '#' && strlen(buf + 1)) - info->solidname = checkp(strdup(buf + 1)); + info->solidname = checkp(strndup(buf + (*buf == '#'), 80)); bp = buf + 80; @@ -344,8 +343,6 @@ parse_file(struct parseinfo *info, char *buf, size_t len, char **modelname) : parse_file_bin(info, buf, len); if (status == FAIL) return FAIL; - if (!info->solidname) info->solidname = checkp(strdup("")); - /* transfer ownership */ info->modelname = *modelname; *modelname = NULL; -- cgit v1.2.3-71-gd317