Replaced some large local variables by other means in xorriso/lib_mgt.c

This commit is contained in:
Thomas Schmitt 2011-05-04 17:16:15 +00:00
parent 6442ca224b
commit 13842113f4
2 changed files with 11 additions and 7 deletions

View File

@ -384,9 +384,11 @@ int Xorriso_report_iso_error(struct XorrisO *xorriso, char *victim,
{
int error_code, iso_sev, min_sev, ret;
char *sev_text_pt, *msg_text_pt= NULL;
char sfe[6*SfileadrL];
char *sfe= NULL;
static int sorry_sev= -1;
Xorriso_alloc_meM(sfe, char, 6 * SfileadrL);
if(sorry_sev<0)
Xorriso__text_to_sev("SORRY", &sorry_sev, 0);
@ -416,6 +418,8 @@ int Xorriso_report_iso_error(struct XorrisO *xorriso, char *victim,
Text_shellsafe(victim, sfe+strlen(sfe), 0);
}
ret= Xorriso_msgs_submit(xorriso, error_code, sfe, os_errno, sev_text_pt, 4);
ex:;
Xorriso_free_meM(sfe);
return(ret);
}
@ -430,7 +434,7 @@ int Xorriso_get_local_charset(struct XorrisO *xorriso, char **name, int flag)
int Xorriso_set_local_charset(struct XorrisO *xorriso, char *name, int flag)
{
int ret;
char *nl_charset, sfe[5 * SfileadrL];
char *nl_charset;
iconv_t iconv_ret= (iconv_t) -1;
nl_charset= nl_langinfo(CODESET);
@ -448,13 +452,13 @@ int Xorriso_set_local_charset(struct XorrisO *xorriso, char *name, int flag)
if(ret <= 0) {
cannot:;
sprintf(xorriso->info_text,
"-local_charset: Cannot assume as local character set: %s",
Text_shellsafe(name, sfe, 0));
"-local_charset: Cannot assume as local character set: ");
Text_shellsafe(name, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
return(0);
}
sprintf(xorriso->info_text, "Local character set is now assumed as: %s",
Text_shellsafe(name, sfe, 0));
sprintf(xorriso->info_text, "Local character set is now assumed as: ");
Text_shellsafe(name, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
return(1);
}

View File

@ -1 +1 @@
#define Xorriso_timestamP "2011.05.04.165840"
#define Xorriso_timestamP "2011.05.04.171628"