summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-07-09 11:50:48 +0900
committerYukihiro Matsumoto <[email protected]>2012-07-09 11:50:48 +0900
commit7496625fc3b2f306e97c8ef12f67a92693e13bf8 (patch)
treeaba746632bc99a06aeff2ee195ff690c954e7b09 /src
parentc3201370554a5d48c59f97daf61a725310d4bbbc (diff)
downloadmruby-7496625fc3b2f306e97c8ef12f67a92693e13bf8.tar.gz
mruby-7496625fc3b2f306e97c8ef12f67a92693e13bf8.zip
initialize stuctures on stack without memset(); close #350
Diffstat (limited to 'src')
-rw-r--r--src/load.c4
-rw-r--r--src/time.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/load.c b/src/load.c
index eb9cd119c..c1c0a7eed 100644
--- a/src/load.c
+++ b/src/load.c
@@ -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;
diff --git a/src/time.c b/src/time.c
index 3da824e82..a8033f95d 100644
--- a/src/time.c
+++ b/src/time.c
@@ -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;