if (dest) {
err = asprintf(dest, format,
(prefix ? prefix : ""), (prefix ? ": " : ""),
- (ctx->func ? ctx->func : ""), (ctx->func ? ": " : ""),
+ (ctx && ctx->func ? ctx->func : ""), (ctx && ctx->func ? ": " : ""),
uci_errstr[err],
error_info);
if (err < 0)
strcat(error_info, "\n");
fprintf(stderr, format,
(prefix ? prefix : ""), (prefix ? ": " : ""),
- (ctx->func ? ctx->func : ""), (ctx->func ? ": " : ""),
+ (ctx && ctx->func ? ctx->func : ""), (ctx && ctx->func ? ": " : ""),
uci_errstr[err],
error_info);
}