mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:37:34 +00:00
Userland: Fix segfault in sort
This commit is contained in:
parent
8e1bda0e9d
commit
a3bcff0db8
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue