From: Ralph Corderoy Date: Wed, 19 Oct 2016 23:24:20 +0000 (+0100) Subject: Replace strlen(), malloc(), and sprintf() with concat(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/61f3b98910da20d4f0935d34a69fd203c092bd8a?hp=b22a846ca4b5e21a3bc3b6d48cf3aa12f181ede0 Replace strlen(), malloc(), and sprintf() with concat(). --- diff --git a/sbr/oauth_prof.c b/sbr/oauth_prof.c index e0fd7584..ab8bc5aa 100644 --- a/sbr/oauth_prof.c +++ b/sbr/oauth_prof.c @@ -139,10 +139,7 @@ mh_oauth_cred_fn(const char *svc) free(component); if (result == NULL) { - result = mh_xmalloc(sizeof "oauth-" - 1 - + strlen(svc) - + 1 /* '\0' */); - sprintf(result, "oauth-%s", svc); + result = concat("oauth-", svc, NULL); result_if_allocated = result; } else { result_if_allocated = NULL;