The map::at method does not always exist, so instead use map::find.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Sat, 26 Sep 2009 19:09:35 +0000 (12:09 -0700)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Sat, 26 Sep 2009 19:09:35 +0000 (12:09 -0700)
Thanks to Achim J. Latz <achim.latz@qustodium.net>.

metadata.cc

index e1ea1aa..2ae0751 100644 (file)
@@ -98,7 +98,7 @@ static string encode_dict(const map<string, string>& dict)
     string result;
 
     if (dict.find("name") != dict.end()) {
-        result += "name: " + dict.at("name") + "\n";
+        result += "name: " + dict.find("name")->second + "\n";
     }
 
     for (map<string, string>::const_iterator i = dict.begin();