You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using cat command to read /sys/class/kxo/kxo/kxo_state file, the
output (e.g., "1 1 0") did not include a newline, causing the terminal
prompt to appear on the same line (e.g., "1 1 0user@Ubuntu:~$").
This truncation issue is diagnosed by examining kxo_state_show, which
uses snprintf with a format string "%c %c %c\n". The size parameter of
snprintf set to 6 included the null terminator \0 as the last character,
leaving only 5 bytes for the desired output (e.g., "1 0 0\n"), thus the
newline symbol \n was truncated by null terminator.
This commit resolves the issue by increasing the size parameter of
snprintf from 6 to 7, ensuring the output includes the newline.
0 commit comments