Dont return count - 1 but count from libnet_smbconf_reg_get_values().
authorMichael Adam <obnox@samba.org>
Sat, 29 Dec 2007 16:02:27 +0000 (17:02 +0100)
committerMichael Adam <obnox@samba.org>
Sat, 29 Dec 2007 16:02:27 +0000 (17:02 +0100)
Michael
(This used to be commit ded60dec7d75db7df485a159fb6bf628d8e24805)

source3/libnet/libnet_conf.c
source3/utils/net_conf.c

index 636e966a37d06dd8e851b3c48a3f70486a330bc2..300ea916cd85718db7d91cda3d2b8291fb4afdbc 100644 (file)
@@ -354,7 +354,7 @@ static WERROR libnet_smbconf_reg_get_values(TALLOC_CTX *mem_ctx,
 
        werr = WERR_OK;
 
-       *num_values = count - 1;
+       *num_values = count;
        if (count > 0) {
                *value_names = talloc_move(mem_ctx, &tmp_valnames);
                *value_strings = talloc_move(mem_ctx, &tmp_valstrings);
index 8791d7cbddcc16988537e2af6d1aaa4f82a1c674..8957408bd6bd4a050dffa4a2a7362e9081d26590 100644 (file)
@@ -541,7 +541,7 @@ static int net_conf_showshare(int argc, const char **argv)
 
        d_printf("[%s]\n", sharename);
 
-       for (count = 0; count <= num_params; count++) {
+       for (count = 0; count < num_params; count++) {
                d_printf("\t%s = %s\n", param_names[count],
                         param_values[count]);
        }