improve validation errors

This commit is contained in:
rumbledethumps
2025-04-27 23:52:23 -07:00
parent 5cb1bc60fc
commit 34bb14bc6e
6 changed files with 10 additions and 6 deletions

View File

@@ -1,12 +1,14 @@
#include <rp6502.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
int __cdecl__ open (const char* name, int flags, ...)
{
size_t namelen = strlen (name);
if (namelen > 255) {
return _mappederrno (EINVAL);
RIA.errno = EINVAL;
return _mappederrno(RIA.errno);
}
while (namelen) {
ria_push_char (name[--namelen]);