From f7f98d9d83cae5aebfcc7cc4725f310d88f0707b Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 9 Nov 2015 12:14:52 +0000 Subject: [PATCH] Clarified handling of NULL name with Xorriso_set_local_charset(). Coverity CID 28719. --- xorriso/lib_mgt.c | 14 +++++++------- xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xorriso/lib_mgt.c b/xorriso/lib_mgt.c index 7a19c019..634b644a 100644 --- a/xorriso/lib_mgt.c +++ b/xorriso/lib_mgt.c @@ -474,14 +474,14 @@ int Xorriso_set_local_charset(struct XorrisO *xorriso, char *name, int flag) nl_charset= nl_langinfo(CODESET); if(name == NULL) name= nl_charset; + if(name == NULL) + goto cannot; - if(name != NULL) { - iconv_ret= iconv_open(nl_charset, name); - if(iconv_ret == (iconv_t) -1) - goto cannot; - else - iconv_close(iconv_ret); - } + iconv_ret= iconv_open(nl_charset, name); + if(iconv_ret == (iconv_t) -1) + goto cannot; + else + iconv_close(iconv_ret); ret= iso_set_local_charset(name, 0); if(ret <= 0) { cannot:; diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index e0c244c6..830f1ac5 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2015.11.09.105122" +#define Xorriso_timestamP "2015.11.09.121421"