diff options
author | Günther Deschner <gd@samba.org> | 2013-12-12 18:24:47 +0100 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2013-12-18 14:48:24 +0100 |
commit | 103e672ef533ad0f4010daa5d3e9183e0894c754 (patch) | |
tree | 1ae3cec3982c066a5812ee6dac1a2b1f31dc99ca /libgpo/gpo_ini.c | |
parent | 785c3c12a9fc6bebdce518bbd1de4f5fcb5c1670 (diff) | |
download | samba-103e672ef533ad0f4010daa5d3e9183e0894c754.tar.gz |
libgpo: support probing for parameters in gp_inifile_get functions.
Guenther
Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'libgpo/gpo_ini.c')
-rw-r--r-- | libgpo/gpo_ini.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libgpo/gpo_ini.c b/libgpo/gpo_ini.c index d08e0e42863..a91bb9217ca 100644 --- a/libgpo/gpo_ini.c +++ b/libgpo/gpo_ini.c @@ -156,7 +156,9 @@ NTSTATUS gp_inifile_getstring(struct gp_inifile_context *ctx, const char *key, c for (i = 0; i < ctx->keyval_count; i++) { if (strcmp(ctx->data[i]->key, key) == 0) { - *ret = ctx->data[i]->val; + if (ret) { + *ret = ctx->data[i]->val; + } return NT_STATUS_OK; } } @@ -176,7 +178,9 @@ NTSTATUS gp_inifile_getint(struct gp_inifile_context *ctx, const char *key, int return result; } - *ret = (int)strtol(value, NULL, 10); + if (ret) { + *ret = (int)strtol(value, NULL, 10); + } return NT_STATUS_OK; } @@ -194,10 +198,14 @@ NTSTATUS gp_inifile_getbool(struct gp_inifile_context *ctx, const char *key, boo } if (strequal(value, "Yes")) { - *ret = true; + if (ret) { + *ret = true; + } return NT_STATUS_OK; } else if (strequal(value, "No")) { - *ret = false; + if (ret) { + *ret = false; + } return NT_STATUS_OK; } |