Kernel: Fix broken passing of String as printf() argument in realpath()

This commit is contained in:
Andreas Kling 2019-08-29 21:01:33 +02:00
commit 6fe0fa30f2
Notes: sideshowbarker 2024-07-19 12:26:12 +09:00

View file

@ -1866,8 +1866,8 @@ int Process::sys$realpath(const char* pathname, char* buffer, size_t size)
// FIXME: Once resolve_path is fixed to deal with .. and . , remove the use of FileSystemPath::canonical_path. // FIXME: Once resolve_path is fixed to deal with .. and . , remove the use of FileSystemPath::canonical_path.
FileSystemPath canonical_path(custody->absolute_path()); FileSystemPath canonical_path(custody->absolute_path());
if (!canonical_path.is_valid()) { if (!canonical_path.is_valid()) {
printf("FileSystemPath failed to canonicalize '%s'\n", custody->absolute_path()); dbg() << "FileSystemPath failed to canonicalize " << custody->absolute_path();
return 1; ASSERT_NOT_REACHED();
} }
strncpy(buffer, canonical_path.string().characters(), size); strncpy(buffer, canonical_path.string().characters(), size);