From fc213876d50909bbd8401794822aaa8a80ec4100 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 8 Sep 2007 04:45:59 +0000 Subject: r25019: Fix coverity bug #105, run #332. Use of uninitialized variable. Jeremy. (This used to be commit a58de8cee51c1396a2607ee743c92d58d7703547) --- source3/utils/net_sam.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source3') diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c index 3cc838e71b..056bd6a0cc 100644 --- a/source3/utils/net_sam.c +++ b/source3/utils/net_sam.c @@ -362,7 +362,8 @@ static int net_sam_set(int argc, const char **argv) static int net_sam_policy_set(int argc, const char **argv) { const char *account_policy = NULL; - uint32 value, old_value; + uint32 value = 0; + uint32 old_value = 0; int field; char *endptr; @@ -409,19 +410,20 @@ static int net_sam_policy_set(int argc, const char **argv) if (!pdb_get_account_policy(field, &old_value)) { d_fprintf(stderr, "Valid account policy, but unable to fetch " "value!\n"); + } else { + d_printf("Account policy \"%s\" value was: %d\n", account_policy, + old_value); } if (!pdb_set_account_policy(field, value)) { d_fprintf(stderr, "Valid account policy, but unable to " "set value!\n"); return -1; + } else { + d_printf("Account policy \"%s\" value is now: %d\n", account_policy, + value); } - d_printf("Account policy \"%s\" value was: %d\n", account_policy, - old_value); - - d_printf("Account policy \"%s\" value is now: %d\n", account_policy, - value); return 0; } -- cgit