Commit 7496625f authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

initialize stuctures on stack without memset(); close #350

parent c3201370
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment