summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.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/contrib/strutl.cc
parent324fc8af296953857ebfc76deaadd4d224e081e3 (diff)
parentf3b8d8571faf62265266ac0f9da60ad73885214b (diff)
merged from lp:~donkult/apt/sid
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r--apt-pkg/contrib/strutl.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index 867bb313b..8dd05b9c0 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -179,14 +179,14 @@ bool ParseQuoteWord(const char *&String,string &Res)
{
if (*C == '"')
{
- for (C++; *C != 0 && *C != '"'; C++);
- if (*C == 0)
+ C = strchr(C + 1, '"');
+ if (C == NULL)
return false;
}
if (*C == '[')
{
- for (C++; *C != 0 && *C != ']'; C++);
- if (*C == 0)
+ C = strchr(C + 1, ']');
+ if (C == NULL)
return false;
}
}
@@ -904,11 +904,10 @@ bool StrToTime(const string &Val,time_t &Result)
{
struct tm Tm;
char Month[10];
- const char *I = Val.c_str();
-
+
// Skip the day of the week
- for (;*I != 0 && *I != ' '; I++);
-
+ const char *I = strchr(Val.c_str(), ' ');
+
// Handle RFC 1123 time
Month[0] = 0;
if (sscanf(I," %d %3s %d %d:%d:%d GMT",&Tm.tm_mday,Month,&Tm.tm_year,