From ff6772ca45b89912f9d335bd4f789b84ea299a52 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 4 May 2011 15:17:10 +0000 Subject: [PATCH] Replaced some large local variables by other means in xorriso/cmp_update.c --- libisoburn/trunk/xorriso/cmp_update.c | 12 +++++++++--- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/libisoburn/trunk/xorriso/cmp_update.c b/libisoburn/trunk/xorriso/cmp_update.c index 95448689..b7902cf2 100644 --- a/libisoburn/trunk/xorriso/cmp_update.c +++ b/libisoburn/trunk/xorriso/cmp_update.c @@ -54,9 +54,13 @@ int Xorriso_compare_2_contents(struct XorrisO *xorriso, char *common_adr, int fd1= -1, ret, r1, r2, done, wanted, i, was_error= 0, use_md5= 0; void *stream2= NULL; off_t r1count= 0, r2count= 0, diffcount= 0, first_diff= -1; - char *respt, buf1[32*1024], buf2[32*1024], offset_text[80]; + char *respt, *buf1= NULL, *buf2= NULL, offset_text[80]; char disk_md5[16], iso_md5[16]; void *ctx= NULL; + int buf_size= 32 * 1024; + + Xorriso_alloc_meM(buf1, char, buf_size); + Xorriso_alloc_meM(buf2, char, buf_size); respt= xorriso->result_line; @@ -108,7 +112,7 @@ cannot_address:; done= 0; while(!done) { - wanted= sizeof(buf1); + wanted= buf_size; if(r1count+offset+wanted>disk_size) wanted= disk_size-r1count-offset; if(r1count+wanted>bytes) @@ -122,7 +126,7 @@ cannot_address:; r1+= ret; } - wanted= sizeof(buf2); + wanted= buf_size; if(r2count+wanted>iso_size) wanted= iso_size-r2count; /* @@ -248,6 +252,8 @@ cannot_address:; ex:; if(ctx != NULL) Xorriso_md5_end(xorriso, &ctx, disk_md5, 0); + Xorriso_free_meM(buf1); + Xorriso_free_meM(buf2); return(ret); } diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index ca03aa0c..7e7044b6 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2011.05.04.151605" +#define Xorriso_timestamP "2011.05.04.151721"