summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r--apt-pkg/contrib/strutl.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index b9bfc2c98..856e5ee9f 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -1114,12 +1114,17 @@ static int HexDigit(int c)
/* The length of the buffer must be exactly 1/2 the length of the string. */
bool Hex2Num(const string &Str,unsigned char *Num,unsigned int Length)
{
+ return Hex2Num(APT::StringView(Str), Num, Length);
+}
+
+bool Hex2Num(const APT::StringView Str,unsigned char *Num,unsigned int Length)
+{
if (Str.length() != Length*2)
return false;
// Convert each digit. We store it in the same order as the string
int J = 0;
- for (string::const_iterator I = Str.begin(); I != Str.end();J++, I += 2)
+ for (auto I = Str.begin(); I != Str.end();J++, I += 2)
{
int first_half = HexDigit(I[0]);
int second_half;