Handle floating point connector coordinates as well as integer (ignores the floating point part).
Correctly handles "42 127 -3", "42.999 127. -3.1415926535897932384626" and "42... 127.0.0.1 -3.0..0...0" as (42, 127, -3). Doesn't handle the floating point and integer mixture "42 127.0 -3".master
parent
bdca765f06
commit
ea1e76a09d
|
@ -486,7 +486,8 @@ static BOOL _imd_load_connectors(const char **ppFileData, iIMDShape *s)
|
|||
|
||||
for (p = s->connectors; p < s->connectors + s->nconnectors; p++)
|
||||
{
|
||||
if (sscanf(pFileData, "%d %d %d%n", &newVector.x, &newVector.y, &newVector.z, &cnt) != 3)
|
||||
if (sscanf(pFileData, "%d %d %d%n", &newVector.x, &newVector.y, &newVector.z, &cnt) != 3 &&
|
||||
sscanf(pFileData, "%d%*[.0-9] %d%*[.0-9] %d%*[.0-9]%n", &newVector.x, &newVector.y, &newVector.z, &cnt) != 3)
|
||||
{
|
||||
debug(LOG_ERROR, "(_load_connectors) file corrupt -M");
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue