The branch, master has been updated via e33c23d... s3:net: simplify padding to single printf call via 6deb1fc... s3:net simplify padding to single printf call from 8a27fde... s3:net: Fix a segfault in "net rpc trustdom list" for overlong domain names
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit e33c23dc5cc2a0fc58f6af1d37f57675cc2c698f Author: Björn Jacke <b...@sernet.de> Date: Wed Oct 14 00:22:08 2009 +0200 s3:net: simplify padding to single printf call commit 6deb1fcc8899c9d462a30712bcc20019819fc176 Author: Björn Jacke <b...@sernet.de> Date: Wed Oct 14 00:19:35 2009 +0200 s3:net simplify padding to single printf call ----------------------------------------------------------------------- Summary of changes: source3/utils/net_rpc.c | 10 ++-------- source3/utils/net_rpc_audit.c | 10 +--------- 2 files changed, 3 insertions(+), 17 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 0e325b5..455405a 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -5777,18 +5777,12 @@ static NTSTATUS rpc_query_domain_sid(struct net_context *c, static void print_trusted_domain(DOM_SID *dom_sid, const char *trusted_dom_name) { - fstring ascii_sid, padding; - int pad_len, col_len = 20; + fstring ascii_sid; /* convert sid into ascii string */ sid_to_fstring(ascii_sid, dom_sid); - /* calculate padding space for d_printf to look nicer */ - pad_len = col_len - strlen(trusted_dom_name); - padding[pad_len] = 0; - do padding[--pad_len] = ' '; while (pad_len); - - d_printf("%s%s%s\n", trusted_dom_name, padding, ascii_sid); + d_printf("%-20s%s\n", trusted_dom_name, ascii_sid); } static NTSTATUS vampire_trusted_domain(struct rpc_pipe_client *pipe_hnd, diff --git a/source3/utils/net_rpc_audit.c b/source3/utils/net_rpc_audit.c index f0b440d..bc3ed3d 100644 --- a/source3/utils/net_rpc_audit.c +++ b/source3/utils/net_rpc_audit.c @@ -40,9 +40,6 @@ static int net_help_audit(struct net_context *c, int argc, const char **argv) static void print_auditing_category(const char *policy, const char *value) { - fstring padding; - int pad_len, col_len = 30; - if (policy == NULL) { policy = N_("Unknown"); } @@ -50,12 +47,7 @@ static void print_auditing_category(const char *policy, const char *value) value = N_("Invalid"); } - /* calculate padding space for d_printf to look nicer */ - pad_len = col_len - strlen(policy); - padding[pad_len] = 0; - do padding[--pad_len] = ' '; while (pad_len > 0); - - d_printf(_("\t%s%s%s\n"), policy, padding, value); + d_printf(_("\t%-30s%s\n"), policy, value); } /******************************************************************** -- Samba Shared Repository