1 |
|
/* |
2 |
|
* extfs.cpp - MacOS file system for native file system access |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2005 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2008 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
158 |
|
uint32 id; // CNID of this file/dir |
159 |
|
uint32 parent_id; // CNID of parent file/dir |
160 |
|
FSItem *parent; // Pointer to parent |
161 |
< |
char name[32]; // Object name (C string) - Host OS |
162 |
< |
char guest_name[32]; // Object name (C string) - Guest OS |
161 |
> |
char *name; // Object name (C string) - Host OS |
162 |
> |
char guest_name[32]; // Object name (C string) - Guest OS |
163 |
|
time_t mtime; // Modification time for get_cat_info caching |
164 |
|
int cache_dircount; // Cached number of files in directory |
165 |
|
}; |
235 |
|
p->id = next_cnid++; |
236 |
|
p->parent_id = parent->id; |
237 |
|
p->parent = parent; |
238 |
< |
strncpy(p->name, name, 31); |
239 |
< |
p->name[31] = 0; |
238 |
> |
p->name = new char[strlen(name) + 1]; |
239 |
> |
strcpy(p->name, name); |
240 |
|
strncpy(p->guest_name, guest_name, 31); |
241 |
|
p->guest_name[31] = 0; |
242 |
|
p->mtime = 0; |
416 |
|
p->id = ROOT_PARENT_ID; |
417 |
|
p->parent_id = 0; |
418 |
|
p->parent = NULL; |
419 |
+ |
p->name = new char[1]; |
420 |
|
p->name[0] = 0; |
421 |
|
p->guest_name[0] = 0; |
422 |
|
|
428 |
|
p->id = ROOT_ID; |
429 |
|
p->parent_id = ROOT_PARENT_ID; |
430 |
|
p->parent = first_fs_item; |
431 |
< |
strncpy(p->name, GetString(STR_EXTFS_VOLUME_NAME), 32); |
432 |
< |
p->name[31] = 0; |
431 |
> |
const char *volume_name = GetString(STR_EXTFS_VOLUME_NAME); |
432 |
> |
p->name = new char[strlen(volume_name) + 1]; |
433 |
> |
strcpy(p->name, volume_name); |
434 |
|
strncpy(p->guest_name, host_encoding_to_macroman(p->name), 32); |
435 |
|
p->guest_name[31] = 0; |
436 |
|
|
455 |
|
FSItem *p = first_fs_item, *next; |
456 |
|
while (p) { |
457 |
|
next = p->next; |
458 |
+ |
delete[] p->name; |
459 |
|
delete p; |
460 |
|
p = next; |
461 |
|
} |