mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 13:13:58 +00:00
COMMON: punycode: move npos guard up
b0d722473b49e27417258f03ee802372f3ee354e introduced code that used ni before this guard that ensures it has a proper value for strings that contain no ASCII component.
This commit is contained in:
parent
fb5982eacb
commit
90c4b57e9a
@ -239,6 +239,10 @@ U32String punycode_decode(const String &src1) {
|
||||
|
||||
size_t di = src.findLastOf('-');
|
||||
|
||||
// If we have no '-', the entire string is non-ASCII character insertions.
|
||||
if (di == String::npos)
|
||||
di = 0;
|
||||
|
||||
Common::String tail;
|
||||
|
||||
// Sometimes strings could contain garbage at the end, like '.zip' added
|
||||
@ -287,10 +291,6 @@ U32String punycode_decode(const String &src1) {
|
||||
}
|
||||
}
|
||||
|
||||
// If we have no '-', the entire string is non-ASCII character insertions.
|
||||
if (di == String::npos)
|
||||
di = 0;
|
||||
|
||||
U32String dst;
|
||||
|
||||
for (size_t i = 0; i < di; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user