Ensure that segments with reused metadata are listed in root descriptor.
[cumulus.git] / util.cc
diff --git a/util.cc b/util.cc
index c1b5f41..38f1f1d 100644 (file)
--- a/util.cc
+++ b/util.cc
@@ -27,7 +27,7 @@ string uri_encode(const string &in)
     for (size_t i = 0; i < in.length(); i++) {
         unsigned char c = in[i];
 
-        if (c >= '+' && c < 0x7f) {
+        if (c >= '+' && c < 0x7f && c != '@') {
             out += c;
         } else {
             char buf[4];
@@ -67,7 +67,7 @@ string uri_decode(const string &in)
     *output = '\0';
 
     string result(buf);
-    delete buf;
+    delete[] buf;
     return result;
 }
 
@@ -98,13 +98,3 @@ long long parse_int(const string &s)
 {
     return strtoll(s.c_str(), NULL, 0);
 }
-
-/* Output a dictionary of string key/value pairs to the given output stream.
- * The format is a sequence of lines of the form "key: value". */
-void dict_output(ostream &o, map<string, string> dict)
-{
-    for (map<string, string>::const_iterator i = dict.begin();
-         i != dict.end(); ++i) {
-        o << i->first << ": " << i->second << "\n";
-    }
-}