From a5f5a335cfd8e52c25319fd65d142176549fe1b0 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 6 May 2011 12:05:39 +0000 Subject: [PATCH] Introduced flag bit1 with Text_shellsafe() for double sized target string --- libisoburn/trunk/xorriso/misc_funct.c | 11 +++++++---- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libisoburn/trunk/xorriso/misc_funct.c b/libisoburn/trunk/xorriso/misc_funct.c index 998e6b46..cfb26db6 100644 --- a/libisoburn/trunk/xorriso/misc_funct.c +++ b/libisoburn/trunk/xorriso/misc_funct.c @@ -1013,19 +1013,22 @@ ex:; /* @param flag bit0= append to out_text rather than overwrite it + bit1= length limit is 10 * SfileadrL rather than 5 * */ char *Text_shellsafe(char *in_text, char *out_text, int flag) { - int l,i,ol= 0,w=0; + int l,i,w=0, limit= 5 * SfileadrL; if(flag&1) - ol= w= strlen(out_text); + w= strlen(out_text); + if(flag & 2) + limit= 10 * SfileadrL; /* enclose everything by hard quotes */ l= strlen(in_text); out_text[w++]= '\''; for(i=0;i5*SfileadrL+ol) + if(w + 7 > limit) goto overflow; /* escape hard quote within the text */ out_text[w++]= '\''; @@ -1034,7 +1037,7 @@ char *Text_shellsafe(char *in_text, char *out_text, int flag) out_text[w++]= '"'; out_text[w++]= '\''; } else { - if(w+3>5*SfileadrL) { + if(w + 3 > limit) { overflow:; strncpy(out_text, "'xorriso: TEXT MUCH TOO LONG ... ",33); break; diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 6c0747ee..f1bc784f 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2011.05.05.163926" +#define Xorriso_timestamP "2011.05.06.120600"