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';