diff --git a/vm/os-linux.cpp b/vm/os-linux.cpp index 0261942462c..5841673fb21 100644 --- a/vm/os-linux.cpp +++ b/vm/os-linux.cpp @@ -3,18 +3,18 @@ namespace factor { const char* vm_executable_path() { - ssize_t bufsiz = 4096; + size_t bufsiz = 4096; // readlink is called in a loop with increasing buffer sizes in case // someone tries to run Factor from a incredibly deeply nested // path. while (true) { char* buf = new char[bufsiz + 1]; - ssize_t size= readlink("/proc/self/exe", buf, bufsiz); + ssize_t size = readlink("/proc/self/exe", buf, bufsiz); if (size < 0) { fatal_error("Cannot read /proc/self/exe", errno); } else { - if (size < bufsiz) { + if (size < ((size_t) bufsiz)) { // Buffer was large enough, return string. buf[size] = '\0'; const char* ret = safe_strdup(buf);