(_krb5_expand_default_cc_name): replace strndup with inline copy

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15393 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-06-15 11:18:16 +00:00
parent 1969416851
commit b251409222

View File

@@ -233,7 +233,11 @@ _krb5_expand_default_cc_name(krb5_context context, const char *str, char **res)
while (str && *str) {
tmp = strstr(str, "%{");
if (tmp && tmp != str) {
append = strndup(str, tmp - str);
append = malloc((tmp - str) + 1);
if (append) {
memcpy(append, str, tmp - str);
append[tmp - str] = '\0';
}
str = tmp;
} else if (tmp) {
tmp2 = strchr(tmp, '}');