summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-11-04 23:38:40 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2015-11-05 12:21:33 +0100
commit4453cfdcf42f7fe6859bb0fc6b310a2a391bee77 (patch)
treec448b9ec5b7dbbd1b6afd495f0831dd95e1c8180 /apt-pkg/contrib/strutl.cc
parent258b9e512c4001e806c5c0966acecd3d742ec6e9 (diff)
encode UTF-8 characters correctly in QuoteString
Limit the field length to a char to avoid bogus FF for utf-8 characters with the default length. Closes: 799123
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r--apt-pkg/contrib/strutl.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index 05624f7fb..396cb7898 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -331,7 +331,7 @@ string QuoteString(const string &Str, const char *Bad)
*I == 0x25 || // percent '%' char
*I <= 0x20 || *I >= 0x7F) // control chars
{
- ioprintf(Res,"%%%02x",(int)*I);
+ ioprintf(Res, "%%%02hhx", *I);
}
else
Res << *I;