mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-time/time.c (mrb_to_time_t): should always initialize usec
This commit is contained in:
@@ -264,6 +264,7 @@ mrb_to_time_t(mrb_state *mrb, mrb_value obj, time_t *usec)
|
||||
else {
|
||||
t = (time_t)mrb_bint_as_int64(mrb, obj);
|
||||
}
|
||||
if (usec) { *usec = 0; }
|
||||
break;
|
||||
}
|
||||
else {
|
||||
@@ -299,7 +300,6 @@ out_of_range:
|
||||
mrb_raisef(mrb, E_ARGUMENT_ERROR, "%v out of Time range", obj);
|
||||
|
||||
/* not reached */
|
||||
if (usec) { *usec = 0; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user