Skip to content

Commit

Permalink
Fix type of value assigned from strlen() in getline.c
Browse files Browse the repository at this point in the history
This was declared as int, but strlen() in posix returns size_t.

https://pubs.opengroup.org/onlinepubs/009604499/functions/strlen.html
  • Loading branch information
aclemons committed Dec 12, 2024
1 parent 93e1cb1 commit 3eb45ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/native/getline.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ char *p;
/* makes a copy of the string */
{
char *s = 0;
int len = strlen(p);
size_t len = strlen(p);
char *nl = strchr(p, '\n');

if (nl) {
Expand Down

0 comments on commit 3eb45ed

Please sign in to comment.