base = "unknown error";
}
if (ctx->err_details == NULL) {
- return ctx->err_formatted = getcpy(base);
+ return ctx->err_formatted = mh_xstrdup(base);
}
ctx->err_formatted = concat(base, ": ", ctx->err_details, NULL);
len = 0;
prefix = "";
} else {
- len = sprintf(s, "%s", base_url);
+ len = strlen(base_url);
+ if (len > size - 1) /* Less one for NUL. */
+ return FALSE;
+ strcpy(s, base_url);
prefix = "?";
}