diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2019-06-17 18:28:52 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2019-06-17 18:28:52 +0200 |
commit | 97553e635d2265ec4aad96b00b1fd72d98437f15 (patch) | |
tree | fe7b9d415707408dccfc9ec329e6e98cff9d7e0a /apt-pkg/contrib/strutl.cc | |
parent | 0cef11a38f14432bf36bf34225ec06c52b2cfb65 (diff) |
RFC1123StrToTime: Accept const std::string& as first argument
We are converting to std::string anyway by passing to
istringstream, and this removes the need for .c_str()
in callers.
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index c00bce5d5..e02067e13 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -995,6 +995,10 @@ static time_t timegm(struct tm *t) method used to ignore the timezone and assume always UTC. */ bool RFC1123StrToTime(const char* const str,time_t &time) { + return RFC1123StrToTime(std::string(str), time); +} +bool RFC1123StrToTime(std::string const &str,time_t &time) +{ unsigned short day = 0; signed int year = 0; // yes, Y23K problem – we going to worry then… std::string weekday, month, datespec, timespec, zone; |