mirror of
https://github.com/vivier/EMILE.git
synced 2024-09-08 19:54:38 +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)
|
int emile_map_bootblock_read(emile_map_t* map, char* bootblock)
|
||||||
{
|
{
|
||||||
char name[16];
|
char name[MAP_NAME_LEN];
|
||||||
int ret;
|
int ret;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ static __attribute__((used)) char* rcsid = "$CVSHeader$";
|
|||||||
|
|
||||||
int emile_map_bootblock_write(emile_map_t* map, char* bootblock)
|
int emile_map_bootblock_write(emile_map_t* map, char* bootblock)
|
||||||
{
|
{
|
||||||
char name[16];
|
char name[MAP_NAME_LEN];
|
||||||
int ret;
|
int ret;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
|
@ -35,7 +35,8 @@ emile_map_t* emile_map_open(char *dev, int flags)
|
|||||||
free(map);
|
free(map);
|
||||||
return NULL;
|
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));
|
ret = read(map->fd, &map->drivers, sizeof(map->drivers));
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
|
@ -91,9 +91,10 @@ struct Partition {
|
|||||||
#define APPLE_VOID "Apple_Void"
|
#define APPLE_VOID "Apple_Void"
|
||||||
#define APPLE_PATCHES "Apple_Patches"
|
#define APPLE_PATCHES "Apple_Patches"
|
||||||
|
|
||||||
|
#define MAP_NAME_LEN 256
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int fd;
|
int fd;
|
||||||
char name[16];
|
char name[MAP_NAME_LEN];
|
||||||
int current;
|
int current;
|
||||||
struct DriverDescriptor drivers;
|
struct DriverDescriptor drivers;
|
||||||
struct Partition partition;
|
struct Partition partition;
|
||||||
|
Loading…
Reference in New Issue
Block a user