Skip to content

Commit

Permalink
Check arguments to IO_gmtime and IO_localtime (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson authored Jan 29, 2024
1 parent 10a7bef commit 4d38b74
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1777,6 +1777,10 @@ static Obj FuncIO_gmtime(Obj self, Obj time)
Obj tmp;
time_t t;
struct tm * s;
if (!IS_INT(time)) {
SyClearErrorNo();
return Fail;
}
if (!IS_INTOBJ(time)) {
tmp = QuoInt(time, INTOBJ_INT(256));
if (!IS_INTOBJ(tmp))
Expand Down Expand Up @@ -1808,6 +1812,10 @@ static Obj FuncIO_localtime(Obj self, Obj time)
Obj tmp;
time_t t;
struct tm * s;
if (!IS_INT(time)) {
SyClearErrorNo();
return Fail;
}
if (!IS_INTOBJ(time)) {
tmp = QuoInt(time, INTOBJ_INT(256));
if (!IS_INTOBJ(tmp))
Expand Down

0 comments on commit 4d38b74

Please sign in to comment.