mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07:35 +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 (;;) {
|
for (;;) {
|
||||||
char* buffer = nullptr;
|
char* buffer = nullptr;
|
||||||
ssize_t buflen = 0;
|
ssize_t buflen = 0;
|
||||||
|
size_t n;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
buflen = getline(&buffer, nullptr, stdin);
|
buflen = getline(&buffer, &n, stdin);
|
||||||
if (buflen == -1 && errno != 0) {
|
if (buflen == -1 && errno != 0) {
|
||||||
perror("getline");
|
perror("getline");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue