A parse_dev debug line erroneously uses %*s instead of %.*s. While this
does not lead to out of boundary access because the line is properly
NUL-escaped by fgets, the output is incorrect.
Simply replace the ending char with NUL for debug, since the line is
modified a few lines below anyway. This offers more safety for
refactoring in the future if fgets is ever replaced with getline,
possibly leading to lines longer than INT_MAX.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
start = skip_over_blank(start + 1);
end = skip_over_word(start);
- DBG(READ, ul_debug("device should be %*s",
- (int)(end - start), start));
+ ON_DBG(READ, {
+ char c = *end;
+ *end = '\0';
+ ul_debug("device should be %s", start);
+ *end = c;
+ });
if (**cp == '>')
*cp = end;