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

This commit is contained in:
Yukihiro Matsumoto
2012-07-09 11:50:48 +09:00
parent c320137055
commit 7496625fc3
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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
View File
@@ -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;