diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-11-10 16:10:55 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-11-10 16:10:55 +0100 |
commit | 37adedc9d0b66eeae7efb88aebd08dfbc6e06f77 (patch) | |
tree | b0769df88e2b6496f23e3d899aeb1c240a3488d9 /apt-pkg/acquire-method.cc | |
parent | cf4f17a9d87a36b20ef5afa2cb5145e466d8ad3b (diff) | |
parent | 04340db392f14e2610189db6f8787e10fbf3c6d0 (diff) |
merged from lp:~donkult/apt/experimental
Diffstat (limited to 'apt-pkg/acquire-method.cc')
-rw-r--r-- | apt-pkg/acquire-method.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc index 1ae139b40..2041fd9e9 100644 --- a/apt-pkg/acquire-method.cc +++ b/apt-pkg/acquire-method.cc @@ -291,12 +291,12 @@ bool pkgAcqMethod::Configuration(string Message) I += Length + 1; for (; I < MsgEnd && *I == ' '; I++); - const char *Equals = I; - for (; Equals < MsgEnd && *Equals != '='; Equals++); - const char *End = Equals; - for (; End < MsgEnd && *End != '\n'; End++); - if (End == Equals) + const char *Equals = (const char*) memchr(I, '=', MsgEnd - I); + if (Equals == NULL) return false; + const char *End = (const char*) memchr(Equals, '\n', MsgEnd - Equals); + if (End == NULL) + End = MsgEnd; Cnf.Set(DeQuoteString(string(I,Equals-I)), DeQuoteString(string(Equals+1,End-Equals-1))); |