mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
Userland: Fix segfault in sort
This commit is contained in:
committed by
Andreas Kling
parent
8e1bda0e9d
commit
a3bcff0db8
@@ -47,8 +47,9 @@ int main(int argc, char** argv)
|
||||
for (;;) {
|
||||
char* buffer = nullptr;
|
||||
ssize_t buflen = 0;
|
||||
size_t n;
|
||||
errno = 0;
|
||||
buflen = getline(&buffer, nullptr, stdin);
|
||||
buflen = getline(&buffer, &n, stdin);
|
||||
if (buflen == -1 && errno != 0) {
|
||||
perror("getline");
|
||||
exit(1);
|
||||
|
||||
Reference in New Issue
Block a user