From eee7c453f28c700769d559f0bab9365d59ba25b6 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 26 Feb 2013 08:23:52 +0000 Subject: [PATCH] Corrected wrong use of sizeof --- xorriso/check_media.c | 14 +++++++------- xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xorriso/check_media.c b/xorriso/check_media.c index c5247443..2f3d033a 100644 --- a/xorriso/check_media.c +++ b/xorriso/check_media.c @@ -1,7 +1,7 @@ /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. - Copyright 2007-2011 Thomas Schmitt, + Copyright 2007-2013 Thomas Schmitt, 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); diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index a1943b91..49c9de7f 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2013.02.18.104738" +#define Xorriso_timestamP "2013.02.26.082331"