Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librc: use return value of rc_getline for len instead of the buffer size #744

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/librc/librc.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ file_regex(const char *file, const char *regex)
{
FILE *fp;
char *line = NULL;
size_t len = 0;
size_t size = 0, len = 0;
regex_t re;
bool retval = true;
int result;
Expand All @@ -192,7 +192,7 @@ file_regex(const char *file, const char *regex)
return false;
}

while ((rc_getline(&line, &len, fp))) {
while ((len = rc_getline(&line, &size, fp))) {
char *str = line;
/* some /proc files have \0 separated content so we have to
loop through the 'line' */
Expand Down
Loading