diff --git a/cameo/gerber.c b/cameo/gerber.c index 9aca5f5..5d26a5b 100644 --- a/cameo/gerber.c +++ b/cameo/gerber.c @@ -37,8 +37,9 @@ struct path *gerber_read(const char *name, double r_tool_default) int lineno = 0; char buf[1024]; struct path *paths = NULL, **anchor = &paths, *path = NULL; - int start_x = 0, start_y = 0; - int x, y, d; + double start_x = 0, start_y = 0; + int xi, yi, d; + double x, y; file = name ? fopen(name, "r") : stdin; if (!file) { @@ -64,10 +65,10 @@ struct path *gerber_read(const char *name, double r_tool_default) } continue; } - if (sscanf(buf, "X%dY%dD%d*\n", &x, &y, &d) != 3) + if (sscanf(buf, "X%dY%dD%d*\n", &xi, &yi, &d) != 3) continue; - x = KU2MM(x); - y = KU2MM(y); + x = KU2MM(xi); + y = KU2MM(yi); switch (d) { case 1: if (!path) {