(_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:
@@ -233,7 +233,11 @@ _krb5_expand_default_cc_name(krb5_context context, const char *str, char **res)
|
|||||||
while (str && *str) {
|
while (str && *str) {
|
||||||
tmp = strstr(str, "%{");
|
tmp = strstr(str, "%{");
|
||||||
if (tmp && tmp != 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;
|
str = tmp;
|
||||||
} else if (tmp) {
|
} else if (tmp) {
|
||||||
tmp2 = strchr(tmp, '}');
|
tmp2 = strchr(tmp, '}');
|
||||||
|
Reference in New Issue
Block a user