mirror of
https://github.com/vivier/EMILE.git
synced 2025-04-02 10:29:57 +00:00
Do note limite device name to 16 characters
This commit is contained in:
parent
e23b98e394
commit
b593442a31
@ -16,7 +16,7 @@ static __attribute__((used)) char* rcsid = "$CVSHeader$";
|
||||
|
||||
int emile_map_bootblock_read(emile_map_t* map, char* bootblock)
|
||||
{
|
||||
char name[16];
|
||||
char name[MAP_NAME_LEN];
|
||||
int ret;
|
||||
int fd;
|
||||
|
||||
|
@ -16,7 +16,7 @@ static __attribute__((used)) char* rcsid = "$CVSHeader$";
|
||||
|
||||
int emile_map_bootblock_write(emile_map_t* map, char* bootblock)
|
||||
{
|
||||
char name[16];
|
||||
char name[MAP_NAME_LEN];
|
||||
int ret;
|
||||
int fd;
|
||||
|
||||
|
@ -35,7 +35,8 @@ emile_map_t* emile_map_open(char *dev, int flags)
|
||||
free(map);
|
||||
return NULL;
|
||||
}
|
||||
strncpy(map->name, dev, 16);
|
||||
strncpy(map->name, dev, MAP_NAME_LEN);
|
||||
map->name[MAP_NAME_LEN - 1] = 0;
|
||||
|
||||
ret = read(map->fd, &map->drivers, sizeof(map->drivers));
|
||||
if (ret == -1)
|
||||
|
@ -91,9 +91,10 @@ struct Partition {
|
||||
#define APPLE_VOID "Apple_Void"
|
||||
#define APPLE_PATCHES "Apple_Patches"
|
||||
|
||||
#define MAP_NAME_LEN 256
|
||||
typedef struct {
|
||||
int fd;
|
||||
char name[16];
|
||||
char name[MAP_NAME_LEN];
|
||||
int current;
|
||||
struct DriverDescriptor drivers;
|
||||
struct Partition partition;
|
||||
|
Loading…
x
Reference in New Issue
Block a user