[Scummvm-git-logs] scummvm master -> 4246b975829879209888a4bc422930b2b430d032

aquadran noreply at scummvm.org
Wed Jan 5 14:54:42 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:
4246b97582 GRIM: Silence sanitizer warning


Commit: 4246b975829879209888a4bc422930b2b430d032
    https://github.com/scummvm/scummvm/commit/4246b975829879209888a4bc422930b2b430d032
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2022-01-05T15:54:36+01:00

Commit Message:
GRIM: Silence sanitizer warning

Changed paths:
    engines/grim/localize.cpp


diff --git a/engines/grim/localize.cpp b/engines/grim/localize.cpp
index e3cb1f2ab78..d270ca81063 100644
--- a/engines/grim/localize.cpp
+++ b/engines/grim/localize.cpp
@@ -107,11 +107,7 @@ Localizer::Localizer() {
 	char *nextline = data;
 	Common::String last_entry;
 	//Read file till end
-	for (char *line = data + 4; line - data <= filesize; line = nextline + 1) {
-		if (line == nullptr || nextline == nullptr) {
-			break;
-		}
-
+	for (char *line = data + 4; nextline != nullptr && (line - data <= filesize); nextline != nullptr && (line = nextline + 1)) {
 		nextline = strchr(line, '\n');
 		//if there is no next line we arrived the last one
 		if (nextline == nullptr) {




More information about the Scummvm-git-logs mailing list