mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
syscalls: stat: fix temporary pathname allocation
This commit is contained in:
@@ -17,7 +17,7 @@ syscallret syscall_stat(const char* path, stat* st){
|
||||
return retv;
|
||||
}
|
||||
|
||||
char* kpath = alloc(strlen(path)); // XXX use proper user strlen func
|
||||
char* kpath = alloc(strlen(path)+1); // XXX use proper user strlen func
|
||||
|
||||
if(!kpath){
|
||||
retv.errno = ENOMEM;
|
||||
@@ -32,7 +32,6 @@ syscallret syscall_stat(const char* path, stat* st){
|
||||
|
||||
int ret = vfs_open(&file, *kpath == '/' ? proc->root : proc->cwd, kpath);
|
||||
|
||||
|
||||
if(ret){
|
||||
retv.errno = ret;
|
||||
goto _ret;
|
||||
|
||||
Reference in New Issue
Block a user