summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2016-09-23 17:07:23 +0200
committerUri Simchoni <uri@samba.org>2016-09-26 20:24:18 +0200
commit04bb54dbd8bc366b034b903d5ca79a6f3bb571f1 (patch)
tree73f33b059809fce81e747735e5c57b4fdd67afd0 /source3/rpc_client
parent2f4f9a086cfa7220663f69d15d27fe67e0a666e3 (diff)
downloadsamba-04bb54dbd8bc366b034b903d5ca79a6f3bb571f1.tar.gz
s3-rpc_client: use spoolss_timestr_to_NTTIME in winreg_printer_date_to_NTTIME
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_winreg_spoolss.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/source3/rpc_client/cli_winreg_spoolss.c b/source3/rpc_client/cli_winreg_spoolss.c
index f2a91e8cad9..2158229fca7 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -493,26 +493,12 @@ static WERROR winreg_printer_write_date(TALLOC_CTX *mem_ctx,
static WERROR winreg_printer_date_to_NTTIME(const char *str, NTTIME *data)
{
- struct tm tm;
- time_t t;
-
- if (strequal(str, "01/01/1601")) {
- *data = 0;
- return WERR_OK;
- }
-
- ZERO_STRUCT(tm);
+ bool ok;
- if (sscanf(str, "%d/%d/%d",
- &tm.tm_mon, &tm.tm_mday, &tm.tm_year) != 3) {
+ ok = spoolss_timestr_to_NTTIME(str, data);
+ if (!ok) {
return WERR_INVALID_PARAMETER;
}
- tm.tm_mon -= 1;
- tm.tm_year -= 1900;
- tm.tm_isdst = -1;
-
- t = mktime(&tm);
- unix_to_nt_time(data, t);
return WERR_OK;
}