[SCM] Samba Shared Repository - branch v3-5-test updated

Björn Jacke bjacke at samba.org
Wed Oct 28 14:34:45 MDT 2009


The branch, v3-5-test has been updated
       via  53c6c53... s3:net: simplify padding to single printf call
       via  37ddb05... s3:net simplify padding to single printf call
      from  83344b3... s3:net: fix output of net rpc trustdom list

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -----------------------------------------------------------------
commit 53c6c535cde05d4c102381d782f235f0339cf6f0
Author: Björn Jacke <bj at sernet.de>
Date:   Wed Oct 14 00:22:08 2009 +0200

    s3:net: simplify padding to single printf call

commit 37ddb05a94342fbb84058c03685c87903e787c48
Author: Björn Jacke <bj at 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 b06f62a..f5de1e6 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -5779,18 +5779,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


More information about the samba-cvs mailing list