commit | b0948a5e73a2c96fc904d65495686b87c342b984 | [log] [tgz] |
---|---|---|
author | Jeff Thompson <jefft0@gmail.com> | Thu Sep 12 14:38:26 2013 -0700 |
committer | Jeff Thompson <jefft0@gmail.com> | Thu Sep 12 14:38:26 2013 -0700 |
tree | 26236cdaa0d1f6975423b5b5b69d16d16ab5c31b | |
parent | 03616c9dbace73f6f39ffb45b37a5198c526a86b [diff] |
In toHex, if argument is null, return "".
diff --git a/ndn-cpp/common.cpp b/ndn-cpp/common.cpp index b4a1bd8..3a00593 100644 --- a/ndn-cpp/common.cpp +++ b/ndn-cpp/common.cpp
@@ -12,6 +12,9 @@ string toHex(const vector<unsigned char>& array) { + if (!&array) + return ""; + ostringstream result; result.flags(ios::hex | ios::uppercase); for (unsigned int i = 0; i < array.size(); ++i) {