Corrected wrong use of sizeof
This commit is contained in:
parent
39f6b1b26f
commit
eee7c453f2
@ -1,7 +1,7 @@
|
||||
|
||||
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
|
||||
|
||||
Copyright 2007-2011 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
Copyright 2007-2013 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
|
||||
Provided under GPL version 2 or later.
|
||||
|
||||
@ -282,11 +282,11 @@ int Sectorbitmap_destroy(struct SectorbitmaP **o, int flag)
|
||||
int Sectorbitmap_from_file(struct SectorbitmaP **o, char *path, char *msg,
|
||||
int *os_errno, int flag)
|
||||
{
|
||||
int ret, fd= -1, sectors, sector_size, i, todo, map_size, skip;
|
||||
int ret, fd= -1, sectors, sector_size, i, todo, map_size, skip, bufsize= 1024;
|
||||
unsigned char *map;
|
||||
unsigned char *buf;
|
||||
|
||||
buf= TSOB_FELD(unsigned char, 1024);
|
||||
buf= TSOB_FELD(unsigned char, bufsize);
|
||||
if(buf == NULL)
|
||||
return(-1);
|
||||
|
||||
@ -320,8 +320,8 @@ wrong_filetype:;
|
||||
sscanf(((char *) buf) + 25, "%d", &skip);
|
||||
if(skip < 0)
|
||||
{ret= 0; goto wrong_filetype;}
|
||||
for(i= 0; i < skip; i+= sizeof(buf)) {
|
||||
todo= sizeof(buf);
|
||||
for(i= 0; i < skip; i+= bufsize) {
|
||||
todo= bufsize;
|
||||
if(i + todo > skip)
|
||||
todo= skip - i;
|
||||
ret= read(fd, buf, todo);
|
||||
@ -345,8 +345,8 @@ wrong_filetype:;
|
||||
}
|
||||
map= (*o)->map;
|
||||
map_size= (*o)->map_size;
|
||||
for(i= 0; i < map_size; i+= sizeof(buf)) {
|
||||
todo= sizeof(buf);
|
||||
for(i= 0; i < map_size; i+= bufsize) {
|
||||
todo= bufsize;
|
||||
if(i + todo > map_size)
|
||||
todo= map_size - i;
|
||||
ret= read(fd, buf, todo);
|
||||
|
@ -1 +1 @@
|
||||
#define Xorriso_timestamP "2013.02.18.104738"
|
||||
#define Xorriso_timestamP "2013.02.26.082331"
|
||||
|
Loading…
Reference in New Issue
Block a user