Skip to content

Commit

Permalink
libgpo: support probing for parameters in gp_inifile_get functions.
Browse files Browse the repository at this point in the history
Guenther

Signed-off-by: Günther Deschner <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
  • Loading branch information
gd authored and cryptomilk committed Dec 18, 2013
1 parent 785c3c1 commit 103e672
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions libgpo/gpo_ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 103e672

Please sign in to comment.