mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
initialize stuctures on stack without memset(); close #350
This commit is contained in:
+2
-2
@@ -248,12 +248,12 @@ mrb_load_irep(mrb_state *mrb, FILE* fp)
|
||||
unsigned char hex8[8], hcrc[4];
|
||||
unsigned char *dst, *rite_dst = NULL;
|
||||
rite_binary_header bin_header;
|
||||
RiteFILE ritefp, *rfp;
|
||||
RiteFILE ritefp = { 0 };
|
||||
RiteFILE *rfp;
|
||||
|
||||
if ((mrb == NULL) || (fp == NULL)) {
|
||||
return MRB_DUMP_INVALID_ARGUMENT;
|
||||
}
|
||||
memset(&ritefp, 0, sizeof(ritefp));
|
||||
ritefp.fp = fp;
|
||||
rfp = &ritefp;
|
||||
|
||||
|
||||
+1
-1
@@ -239,7 +239,7 @@ time_mktime(mrb_state *mrb, mrb_int ayear, mrb_int amonth, mrb_int aday,
|
||||
enum mrb_timezone timezone)
|
||||
{
|
||||
time_t nowsecs;
|
||||
struct tm nowtime;
|
||||
struct tm nowtime = { 0 };
|
||||
|
||||
memset(&nowtime, 0, sizeof(struct tm));
|
||||
nowtime.tm_year = (int)ayear - 1900;
|
||||
|
||||
Reference in New Issue
Block a user