From bc93d238ddc890410d4fc674f7f6989a0b35676d Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 3 Dec 2024 16:15:16 +0200 Subject: [PATCH] LibC: Fix fread argument order in gethostname --- userspace/libraries/LibC/unistd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userspace/libraries/LibC/unistd.cpp b/userspace/libraries/LibC/unistd.cpp index aad4367e..fbc8ef0f 100644 --- a/userspace/libraries/LibC/unistd.cpp +++ b/userspace/libraries/LibC/unistd.cpp @@ -142,7 +142,7 @@ int gethostname(char* name, size_t namelen) FILE* fp = fopen("/etc/hostname", "r"); if (fp == NULL) return -1; - size_t nread = fread(name, namelen - 1, 1, fp); + size_t nread = fread(name, 1, namelen - 1, fp); while (nread > 0 && name[nread - 1] == '\n') nread--; name[nread] = '\0';