mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +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;
|
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){
|
if(!kpath){
|
||||||
retv.errno = ENOMEM;
|
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);
|
int ret = vfs_open(&file, *kpath == '/' ? proc->root : proc->cwd, kpath);
|
||||||
|
|
||||||
|
|
||||||
if(ret){
|
if(ret){
|
||||||
retv.errno = ret;
|
retv.errno = ret;
|
||||||
goto _ret;
|
goto _ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user