Browse Source

[3282] Removed use of std::string::back

Didn't notice but back() is new and not supported on older
versions of C++.
Thomas Markwalder 11 years ago
parent
commit
f9cea380de
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/lib/dhcpsrv/d2_client.cc

+ 5 - 1
src/lib/dhcpsrv/d2_client.cc

@@ -254,7 +254,11 @@ std::string
 D2ClientMgr::qualifyName(const std::string& partial_name) const {
     std::ostringstream gen_name;
     gen_name << partial_name << "." << d2_client_config_->getQualifyingSuffix();
-    if (gen_name.str().back() != '.') {
+
+    // Tack on a trailing dot in case suffix doesn't have one.
+    const char* str = gen_name.str().c_str();
+    size_t len = strlen(str);
+    if ((len > 0) && (str[len-1] != '.')) {
         gen_name << ".";
     }