mruby-time/time.c (mrb_to_time_t): should always initialize usec

This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-04-03 08:46:30 +09:00
parent 875e0b0b59
commit 65897145aa
+1 -1
View File
@@ -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;
}