Skip to content

Commit 5db9cd9

Browse files
authored
Merge pull request #3826 from smoe/caterp_fix_scanf
canterp presumed missinterpretation of scanf return value
2 parents fc13912 + 4f3477a commit 5db9cd9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/emc/canterp/canterp.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ int Canterp::execute(const char *line) {
299299
}
300300

301301
if (!strcmp(the_command_name, "STRAIGHT_PROBE")) {
302-
if (6 != sscanf(the_command_args, "%lf %lf %lf %lf %lf %lf %lf %lf %lf",
302+
if (9 != sscanf(the_command_args, "%lf %lf %lf %lf %lf %lf %lf %lf %lf",
303303
&d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9)) {
304304
return INTERP_ERROR;
305305
}
@@ -325,7 +325,7 @@ int Canterp::execute(const char *line) {
325325

326326
#if 0
327327
if (!strcmp(the_command_name, "SET_ORIGIN_OFFSETS")) {
328-
if (6 != sscanf(the_command_args, "%lf %lf %lf %lf %lf %lf %lf %lf %lf",
328+
if (9 != sscanf(the_command_args, "%lf %lf %lf %lf %lf %lf %lf %lf %lf",
329329
&d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9)) {
330330
return INTERP_ERROR;
331331
}
@@ -389,7 +389,7 @@ int Canterp::execute(const char *line) {
389389

390390
#if 0
391391
if (!strcmp(the_command_name, "USE_TOOL_LENGTH_OFFSET")) {
392-
if (1 != sscanf(the_command_args, "%lf %lf %lf", &d1, &d2, &d3)) {
392+
if (3 != sscanf(the_command_args, "%lf %lf %lf", &d1, &d2, &d3)) {
393393
return INTERP_ERROR;
394394
}
395395
USE_TOOL_LENGTH_OFFSET(d1, d2, d3);

0 commit comments

Comments
 (0)