summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-method.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@debian-devbox>2011-10-14 11:54:12 +0200
committerMichael Vogt <egon@debian-devbox>2011-10-14 11:54:12 +0200
commit1d51f78e9d128191ff8b2d48e42d90ebdbff2588 (patch)
treeaf05e41a53bcc9f22f146573ed0f1ff5311b97ad /apt-pkg/acquire-method.cc
parent324fc8af296953857ebfc76deaadd4d224e081e3 (diff)
parentf3b8d8571faf62265266ac0f9da60ad73885214b (diff)
merged from lp:~donkult/apt/sid
Diffstat (limited to 'apt-pkg/acquire-method.cc')
-rw-r--r--apt-pkg/acquire-method.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc
index 7e9061e56..294d78f86 100644
--- a/apt-pkg/acquire-method.cc
+++ b/apt-pkg/acquire-method.cc
@@ -285,12 +285,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)));