From 8b4b5602501c5cae16fad17316ca362a710a4d79 Mon Sep 17 00:00:00 2001 From: jackfiled Date: Wed, 25 May 2022 11:03:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E4=B8=AD=E5=9C=A8=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E6=9C=80=E5=90=8E=E4=B8=80=E8=A1=8C=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bus_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bus_io.c b/src/bus_io.c index e87c575..a4f63c4 100644 --- a/src/bus_io.c +++ b/src/bus_io.c @@ -70,7 +70,7 @@ rail_node_t *ReadConfigFile() } // 讲道理,应该只有两位数,所以就这样处理了 - if (*(p + 1) == '\n') + if (*(p + 1) == '\n' || *(p + 1) == '\0') { total_station = *p - 48; } @@ -125,7 +125,7 @@ rail_node_t *ReadConfigFile() p++; } - if (*(p + 1) == '\n') + if (*(p + 1) == '\n' || *(p + 1) == '\0') { distance = *p - 48; }