diff options
author | Adam Tkac <atkac@redhat.com> | 2009-09-04 10:16:58 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2009-09-04 10:16:58 +0000 |
commit | 97abe8a548ff9ca940d568128b21813b8a253872 (patch) | |
tree | d38ea6a539b2cc4e70d9569e71985914818546cd /common/rfb/Configuration.cxx | |
parent | 8ed9009b4c4f497a95114d878334de3e13457bdd (diff) | |
download | tigervnc-97abe8a548ff9ca940d568128b21813b8a253872.tar.gz tigervnc-97abe8a548ff9ca940d568128b21813b8a253872.zip |
Replace rfb::strDup by safe_strdup and remove rfb::strFree in favor of free()
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3889 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb/Configuration.cxx')
-rw-r--r-- | common/rfb/Configuration.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/common/rfb/Configuration.cxx b/common/rfb/Configuration.cxx index 9ebc20a8..fd4c23ae 100644 --- a/common/rfb/Configuration.cxx +++ b/common/rfb/Configuration.cxx @@ -67,7 +67,7 @@ Configuration* Configuration::global() { // -=- Configuration implementation Configuration::Configuration(const char* name_, Configuration* attachToGroup) -: name(strDup(name_)), head(0), _next(0) { +: name(safe_strdup(name_)), head(0), _next(0) { if (attachToGroup) { _next = attachToGroup->_next; attachToGroup->_next = this; @@ -182,7 +182,7 @@ void Configuration::list(int width, int nameWidth) { if (column + (int)strlen(def_str) + 11 > width) fprintf(stderr,"\n%*s",nameWidth+4,""); fprintf(stderr," (default=%s)\n",def_str); - strFree(def_str); + free(def_str); } else { fprintf(stderr,"\n"); } @@ -315,11 +315,11 @@ void BoolParameter::setParam(bool b) { char* BoolParameter::getDefaultStr() const { - return strDup(def_value ? "1" : "0"); + return safe_strdup(def_value ? "1" : "0"); } char* BoolParameter::getValueStr() const { - return strDup(value ? "1" : "0"); + return safe_strdup(value ? "1" : "0"); } bool BoolParameter::isBool() const { @@ -381,7 +381,7 @@ IntParameter::operator int() const { StringParameter::StringParameter(const char* name_, const char* desc_, const char* v, Configuration* conf) - : VoidParameter(name_, desc_, conf), value(strDup(v)), def_value(v) + : VoidParameter(name_, desc_, conf), value(safe_strdup(v)), def_value(v) { if (!v) { fprintf(stderr,"Default value <null> for %s not allowed\n",name_); @@ -390,7 +390,7 @@ StringParameter::StringParameter(const char* name_, const char* desc_, } StringParameter::~StringParameter() { - strFree(value); + free(value); } bool StringParameter::setParam(const char* v) { @@ -400,17 +400,17 @@ bool StringParameter::setParam(const char* v) { throw rfb::Exception("setParam(<null>) not allowed"); vlog.debug("set %s(String) to %s", getName(), v); CharArray oldValue(value); - value = strDup(v); + value = safe_strdup(v); return value != 0; } char* StringParameter::getDefaultStr() const { - return strDup(def_value); + return safe_strdup(def_value); } char* StringParameter::getValueStr() const { LOCK_CONFIG; - return strDup(value); + return safe_strdup(value); } // -=- BinaryParameter |