enowars5-service-stldoctor

STL-Analyzing A/D Service for ENOWARS5 in 2021
git clone https://git.sinitax.com/sinitax/enowars5-service-stldoctor
Log | Files | Refs | README | LICENSE | sfeed.txt

commit 947286221696d24aa06d711dfdc4636a07cb6ccf
parent af37f8075b0c1225f5e49339565bb6738c4d1f20
Author: Louis Burda <quent.burda@gmail.com>
Date:   Wed,  7 Jul 2021 11:48:06 +0200

minimized service dependencies in Dockerfile, fixed STL parsing of files with no solidname after endsolid

Diffstat:
Mservice/Dockerfile | 3++-
Mservice/src/stlfile.c | 2+-
Msrc/stlfile.c | 2+-
Mtests/data/evil1.stl | 2+-
4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/service/Dockerfile b/service/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:18.04 -RUN apt update && apt install -y --no-install-recommends socat build-essential +RUN apt update && apt install -y --no-install-recommends socat gcc make libc6-dev libc6 libc-dev-bin RUN addgroup --system service RUN adduser --system --ingroup service --uid 1000 service @@ -17,6 +17,7 @@ WORKDIR /service/ RUN make clean && make EXPOSE 9000 + ENV RESULTDIR=/data/uploads ENTRYPOINT ["/entrypoint.sh"] diff --git a/service/src/stlfile.c b/service/src/stlfile.c @@ -83,7 +83,7 @@ consume_arg(char **start, char **end) if (!*start) return NULL; for (c = *start; *c && !isws(*c); c++); tmp = *start; - *start = c + 1; + *start = c + (*c ? 1 : 0); *end = c; return tmp; } diff --git a/src/stlfile.c b/src/stlfile.c @@ -83,7 +83,7 @@ consume_arg(char **start, char **end) if (!*start) return NULL; for (c = *start; *c && !isws(*c); c++); tmp = *start; - *start = c + 1; + *start = c + (*c ? 1 : 0); *end = c; return tmp; } diff --git a/tests/data/evil1.stl b/tests/data/evil1.stl @@ -1,5 +1,5 @@ solid test˙ -facet normal 0 0 1.0 + facet normal 0 0 1.0 outer loop vertex 1 0 0 vertex 1 1 0