[Scummvm-git-logs] scummvm master -> 90c4b57e9aeac8807d6b03786f440c46270f23e1

mistydemeo noreply at scummvm.org
Wed Jun 7 21:57:02 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
90c4b57e9a COMMON: punycode: move npos guard up


Commit: 90c4b57e9aeac8807d6b03786f440c46270f23e1
    https://github.com/scummvm/scummvm/commit/90c4b57e9aeac8807d6b03786f440c46270f23e1
Author: Misty De Meo (mistydemeo at gmail.com)
Date: 2023-06-07T14:55:41-07:00

Commit Message:
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.

Changed paths:
    common/punycode.cpp


diff --git a/common/punycode.cpp b/common/punycode.cpp
index f6aba9c7a73..1b9344beb80 100644
--- a/common/punycode.cpp
+++ b/common/punycode.cpp
@@ -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++) {




More information about the Scummvm-git-logs mailing list