const char *path, const char *key)
{
size_t len = sizeof ".conf";
- char slash[2] = {'/'};
char *buf = alloca(strlen(path) + 1 + strlen(key) + len);
- strcpy(stpcpy(stpcpy(stpcpy(buf, path), slash), key), ".conf");
+ sprintf(buf, "%s/%s.conf", path, key);
return protolib_cache_file(cache, buf, 0);
}
|| (*retp == NULL
&& load_config(cache, key, 0, retp) < 0))
{
- if (!own_key)
- free((void *) key);
fprintf(stderr,
"Error occurred when attempting to load a prototype "
"library for %s.\n", key);
+ if (!own_key)
+ free((void *) key);
return -1;
}