修复了读取配置文件中在读取最后一行可能读取失败的问题
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user