mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-07-26 21:08:45 +08:00
safer stl/module.nas & add stl/file.nas encapsulated from lib.nas/io
This commit is contained in:
@@ -757,6 +757,8 @@ nasal_ref builtin_read(nasal_ref* local,nasal_gc& gc)
|
||||
return builtin_err("read","not a correct filehandle");
|
||||
if(buf.type!=vm_str)
|
||||
return builtin_err("read","\"buf\" must be string");
|
||||
if(buf.value.gcobj->unmut)
|
||||
return builtin_err("read","\"buf\" is not a mutable string");
|
||||
if(len.type!=vm_num)
|
||||
return builtin_err("read","\"len\" must be number");
|
||||
if(len.num()<=0 || len.num()>=(1<<30))
|
||||
|
||||
Reference in New Issue
Block a user