[Scummvm-git-logs] scummvm master -> 27971587a5ef7d0b6026c7ed9e9365630cde1e67

lephilousophe noreply at scummvm.org
Sat Oct 15 10:32:24 UTC 2022


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:
27971587a5 BACKENDS: OPENGL: Proper unsigned int parsing


Commit: 27971587a5ef7d0b6026c7ed9e9365630cde1e67
    https://github.com/scummvm/scummvm/commit/27971587a5ef7d0b6026c7ed9e9365630cde1e67
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-10-15T12:31:12+02:00

Commit Message:
BACKENDS: OPENGL: Proper unsigned int parsing

Changed paths:
    backends/graphics/opengl/pipelines/libretro/parser.cpp


diff --git a/backends/graphics/opengl/pipelines/libretro/parser.cpp b/backends/graphics/opengl/pipelines/libretro/parser.cpp
index 1e1d7aae7a0..efa7c6485dd 100644
--- a/backends/graphics/opengl/pipelines/libretro/parser.cpp
+++ b/backends/graphics/opengl/pipelines/libretro/parser.cpp
@@ -34,8 +34,6 @@
 
 #include "common/textconsole.h"
 
-#include <limits.h>
-
 namespace OpenGL {
 namespace LibRetro {
 
@@ -193,10 +191,10 @@ bool PresetParser::lookUpValue(const Common::String &key, uint *value) {
 	StringMap::const_iterator iter = _entries.find(key);
 	if (iter != _entries.end()) {
 		char *endptr;
-		const long uintVal = strtol(iter->_value.c_str(), &endptr, 0);
+		const unsigned long uintVal = strtoul(iter->_value.c_str(), &endptr, 0);
 		// Original libretro is quite laxist with int values and only checks errno
 		// This means that as long as there is some number at start, parsing won't fail
-		if (endptr == iter->_value.c_str() || uintVal >= UINT_MAX || uintVal < 0) {
+		if (endptr == iter->_value.c_str() || uintVal >= UINT_MAX) {
 			_errorDesc = "Invalid unsigned integer value for key '" + key + "': '" + iter->_value + '\'';
 			return false;
 		} else {




More information about the Scummvm-git-logs mailing list