From 4453cfdcf42f7fe6859bb0fc6b310a2a391bee77 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 4 Nov 2015 23:38:40 +0100 Subject: 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 --- apt-pkg/contrib/strutl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/contrib/strutl.cc') 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; -- cgit v1.2.3-70-g09d2