- free(fspec.file);
- /* 8 chars in yiaddr + \0 */
- fspec.file = malloc(9);
- if (!fspec.file)
- goto out;
-
- strcpy(fspec.file, "/etc/");
- strcat(fspec.file, prom_get_ip(packet));
+ /* no need to realloc for /etc/ + 8 chars in yiaddr + \0 */
+ sprintf(fspec.file, "%s%s", cfgpath, prom_get_ip(packet));