From f90fe1906856fd708f2f62f49486f94bfacf255f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 23 Jan 2012 10:23:37 -0600 Subject: wmc: fix init command Actually read what struct tm contains and use it correctly, and fix the init command struct size. --- libwmc/src/commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libwmc/src/commands.c') diff --git a/libwmc/src/commands.c b/libwmc/src/commands.c index 45976f19..e617eabf 100644 --- a/libwmc/src/commands.c +++ b/libwmc/src/commands.c @@ -84,8 +84,8 @@ wmc_cmd_init_new (char *buf, size_t buflen, int wmc2) memset (cmd, 0, sizeof (*cmd)); cmd->hdr.marker = WMC_CMD_MARKER; cmd->hdr.cmd = WMC_CMD_INIT; - cmd->year = htole16 (tm->tm_year); - cmd->month = tm->tm_mon; + cmd->year = htole16 (tm->tm_year + 1900); + cmd->month = tm->tm_mon + 1; cmd->day = htobe16 (tm->tm_mday); cmd->hours = htobe16 (tm->tm_hour); cmd->minutes = htobe16 (tm->tm_min); -- cgit v1.2.3-70-g09d2