Skip to content

Commit

Permalink
Fix blank lines in tuning files (#2185)
Browse files Browse the repository at this point in the history
Since `fgets` stores the terminating newline (if any), this should also
be checked in order to allow completely blank lines.
  • Loading branch information
sortraev authored Oct 8, 2024
1 parent 7694663 commit a690695
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rts/c/tuning.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


int is_blank_line_or_comment(const char *s) {
size_t i = strspn(s, " \t");
size_t i = strspn(s, " \t\n");
return s[i] == '\0' || // Line is blank.
strncmp(s + i, "--", 2) == 0; // Line is comment.
}
Expand Down

0 comments on commit a690695

Please sign in to comment.