Skip to content

Commit

Permalink
Check arguments to IO_gmtime and IO_localtime
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson committed Jan 24, 2024
1 parent eb46ba8 commit edfbed9
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 edfbed9

Please sign in to comment.