aboutsummaryrefslogtreecommitdiffstats
path: root/src/stlfile.c
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2021-07-08 16:38:54 +0200
committerLouis Burda <quent.burda@gmail.com>2021-07-08 16:38:54 +0200
commita501ef438acfb88bf822ea12e1fdd586e8e1baaf (patch)
tree54155dc785472dce8960e1abfe3ddb58607ae080 /src/stlfile.c
parent7843ea76385b27a34d4fe74d95a38a95c395491e (diff)
downloadenowars5-service-stldoctor-a501ef438acfb88bf822ea12e1fdd586e8e1baaf.tar.gz
enowars5-service-stldoctor-a501ef438acfb88bf822ea12e1fdd586e8e1baaf.zip
use usual random ids for modelname and solidname in havoc 15, various smaller fixes
Diffstat (limited to 'src/stlfile.c')
-rw-r--r--src/stlfile.c5
1 files changed, 1 insertions, 4 deletions
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;