summaryrefslogtreecommitdiffabout
path: root/lib/params.cc
authorMichael Krelin <hacker@klever.net>2007-01-12 14:21:03 (UTC)
committer Michael Krelin <hacker@klever.net>2007-01-12 14:21:03 (UTC)
commit83516ff76d24142cdc5193875ee7b684652f2eaf (patch) (side-by-side diff)
treeee0eedac2f6bb63beaa25291fab47fe40d1e8662 /lib/params.cc
parent782d7a9e2c07ff6621b754595642aa3fec377bd2 (diff)
downloadlibopkele-83516ff76d24142cdc5193875ee7b684652f2eaf.zip
libopkele-83516ff76d24142cdc5193875ee7b684652f2eaf.tar.gz
libopkele-83516ff76d24142cdc5193875ee7b684652f2eaf.tar.bz2
Be a bit more liberal in what we accept as key-value pairs
Diffstat (limited to 'lib/params.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--lib/params.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/params.cc b/lib/params.cc
index 03867d5..b181811 100644
--- a/lib/params.cc
+++ b/lib/params.cc
@@ -30,13 +30,14 @@ namespace opkele {
string::size_type co = kv.find(':',p);
if(co==string::npos)
break;
string::size_type nl = kv.find('\n',co+1);
if(nl==string::npos)
throw bad_input(OPKELE_CP_ "malformed input");
- insert(value_type(kv.substr(p,co-p),kv.substr(co+1,nl-co-1)));
+ if(nl>co)
+ insert(value_type(kv.substr(p,co-p),kv.substr(co+1,nl-co-1)));
p = nl+1;
}
}
void params_t::sign(secret_t secret,string& sig,const string& slist,const char *prefix) const {
string kv;