Skip to content

Commit

Permalink
gcode: Improve checksum detection in get_raw_command_parameters()
Browse files Browse the repository at this point in the history
Only consider a trailing '*' to indicate a checksum if the remainder
of the string is a number.

Signed-off-by: Kevin O'Connor <[email protected]>
  • Loading branch information
KevinOConnor committed Dec 1, 2024
1 parent a6df541 commit 2165c90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion klippy/gcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def get_raw_command_parameters(self):
# Skip any gcode line-number and ignore any trailing checksum
param_start += origline.upper().find(command)
end = origline.rfind('*')
if end >= 0:
if end >= 0 and origline[end+1:].isdigit():
param_end = end
if origline[param_start:param_start+1].isspace():
param_start += 1
Expand Down

0 comments on commit 2165c90

Please sign in to comment.