summaryrefslogtreecommitdiff
path: root/source3/rpc_client/init_spoolss.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2017-07-11 13:50:09 +0200
committerVolker Lendecke <vl@samba.org>2017-07-12 17:45:24 +0200
commit9c68f99654c851491a4fb499a358af6c400a8dea (patch)
tree40d7fd1f6bf4e287d13bcd669eb65b239d5ae412 /source3/rpc_client/init_spoolss.c
parent3799a32e41134a2dff797ebeacf5abdb8d332e6e (diff)
downloadsamba-9c68f99654c851491a4fb499a358af6c400a8dea.tar.gz
spoolss: Fix CID 1414784 Uninitialized scalar variable
"struct tm" can contain more members than we explicitly initialize. Initialize them all. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/rpc_client/init_spoolss.c')
-rw-r--r--source3/rpc_client/init_spoolss.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source3/rpc_client/init_spoolss.c b/source3/rpc_client/init_spoolss.c
index a806fc6ce09..e5f70c0b045 100644
--- a/source3/rpc_client/init_spoolss.c
+++ b/source3/rpc_client/init_spoolss.c
@@ -48,15 +48,15 @@ bool init_systemtime(struct spoolss_Time *r,
time_t spoolss_Time_to_time_t(const struct spoolss_Time *r)
{
- struct tm unixtime;
-
- unixtime.tm_year = r->year - 1900;
- unixtime.tm_mon = r->month - 1;
- unixtime.tm_wday = r->day_of_week;
- unixtime.tm_mday = r->day;
- unixtime.tm_hour = r->hour;
- unixtime.tm_min = r->minute;
- unixtime.tm_sec = r->second;
+ struct tm unixtime = {
+ .tm_year = r->year - 1900,
+ .tm_mon = r->month - 1,
+ .tm_wday = r->day_of_week,
+ .tm_mday = r->day,
+ .tm_hour = r->hour,
+ .tm_min = r->minute,
+ .tm_sec = r->second,
+ };
return mktime(&unixtime);
}