mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-06-26 00:29:27 +00:00
Kill a magic number and ensure file_name is nul-terminated
This commit is contained in:
parent
3f38467c93
commit
064070be7c
|
@ -765,7 +765,8 @@ const char *c_new_diskette_6(int drive, const char * const raw_file_name, int fo
|
|||
cut_gz(file_name);
|
||||
}
|
||||
|
||||
strncpy(disk6.disk[drive].file_name, file_name, 1023);
|
||||
strncpy(disk6.disk[drive].file_name, file_name, FILE_NAME_SZ-1);
|
||||
disk6.disk[drive].file_name[FILE_NAME_SZ-1] = '\0';
|
||||
disk6.disk[drive].nibblized = is_nib(file_name);
|
||||
disk6.disk[drive].skew_table = skew_table_6_do;
|
||||
if (is_po(file_name)) {
|
||||
|
|
|
@ -34,10 +34,11 @@
|
|||
#define NIB_SEC_SIZE (NIB_TRACK_SIZE/NUM_SECTORS)
|
||||
|
||||
#define DSK_VOLUME 254
|
||||
#define FILE_NAME_SZ (PATH_MAX>>2)
|
||||
|
||||
typedef struct diskette_t {
|
||||
uint8_t track_image[NIB_TRACK_SIZE];
|
||||
char file_name[1024];
|
||||
char file_name[FILE_NAME_SZ];
|
||||
bool nibblized;
|
||||
bool is_protected;
|
||||
bool track_valid;
|
||||
|
|
Loading…
Reference in New Issue
Block a user