{
PDIR_RECORD d;
- d = calloc(1, sizeof(DIR_RECORD));
+ d = calloc(1, sizeof(*d));
if (d == NULL)
error_exit("Insufficient memory");
d->next_in_memory = root.next_in_memory;
char *n;
*/
- d = calloc(1, sizeof(DIR_RECORD));
+ d = calloc(1, sizeof(*d));
if (d == NULL)
error_exit("Insufficient memory");
d->next_in_memory = root.next_in_memory;
last_slash = strrchr(name, '\\');
if (!last_slash)
{
- free(*dirname);
*dirname = malloc(1);
**dirname = 0;
}
char *newdata = malloc(last_slash - name + 1);
memcpy(newdata, name, last_slash - name);
newdata[last_slash - name] = 0;
- free(*dirname);
*dirname = newdata;
}
}
{
struct target_file *tf;
struct target_dir_entry *de;
- const char *filename = chop_filename(target);
char *targetdir = NULL;
char *targetnorm;
chop_dirname(target, &targetdir);
tf->next = de->head;
de->head = tf;
tf->source_name = strdup(source);
- tf->target_name = strdup(filename);
+ tf->target_name = strdup(chop_filename(target));
}
static struct target_dir_entry *