diff options
author | Andreas Schneider <asn@samba.org> | 2012-10-11 14:46:56 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2012-10-11 18:49:15 +0200 |
commit | cabd2b2e960a7d6346b621a4cf37429c944a7720 (patch) | |
tree | e245a7cefe57724e4b77249b782761b8a0525c8f /source3 | |
parent | 49959cffc5717764cc4a5a654eab63bfe5f21603 (diff) | |
download | samba-cabd2b2e960a7d6346b621a4cf37429c944a7720.tar.gz samba-cabd2b2e960a7d6346b621a4cf37429c944a7720.tar.bz2 samba-cabd2b2e960a7d6346b621a4cf37429c944a7720.zip |
s3fs-printing: Simplify the comment and location handling.
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Oct 11 18:49:15 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r-- | source3/printing/printer_list.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/source3/printing/printer_list.c b/source3/printing/printer_list.c index 0afb84bd4d..6e02ee5f72 100644 --- a/source3/printing/printer_list.c +++ b/source3/printing/printer_list.c @@ -148,8 +148,6 @@ NTSTATUS printer_list_set_printer(TALLOC_CTX *mem_ctx, TDB_DATA data; uint64_t time_64; uint32_t time_h, time_l; - const char *str = NULL; - const char *str2 = NULL; NTSTATUS status; int len; @@ -164,24 +162,25 @@ NTSTATUS printer_list_set_printer(TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - if (comment) { - str = comment; - } else { - str = ""; + if (comment == NULL) { + comment = ""; } - if (location) { - str2 = location; - } else { - str2 = ""; + if (location == NULL) { + location = ""; } - time_64 = last_refresh; time_l = time_64 & 0xFFFFFFFFL; time_h = time_64 >> 32; - len = tdb_pack(NULL, 0, PL_DATA_FORMAT, time_h, time_l, name, str, str2); + len = tdb_pack(NULL, 0, + PL_DATA_FORMAT, + time_h, + time_l, + name, + comment, + location); data.dptr = talloc_array(key, uint8_t, len); if (!data.dptr) { @@ -192,7 +191,12 @@ NTSTATUS printer_list_set_printer(TALLOC_CTX *mem_ctx, data.dsize = len; len = tdb_pack(data.dptr, data.dsize, - PL_DATA_FORMAT, time_h, time_l, name, str, str2); + PL_DATA_FORMAT, + time_h, + time_l, + name, + comment, + location); status = dbwrap_store_bystring_upper(db, key, data, TDB_REPLACE); |