[Scummvm-git-logs] scummvm master -> 7920589ba7bfc95514d7c609e49e3f5438130356

digitall noreply at scummvm.org
Thu Jun 9 22:20:25 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:
7920589ba7 DEVTOOLS: Fix Format Overflow GCC Warnings in create_engine Tool


Commit: 7920589ba7bfc95514d7c609e49e3f5438130356
    https://github.com/scummvm/scummvm/commit/7920589ba7bfc95514d7c609e49e3f5438130356
Author: D G Turner (digitall at scummvm.org)
Date: 2022-06-09T23:19:51+01:00

Commit Message:
DEVTOOLS: Fix Format Overflow GCC Warnings in create_engine Tool

Changed paths:
    devtools/create_engine/create_engine.cpp


diff --git a/devtools/create_engine/create_engine.cpp b/devtools/create_engine/create_engine.cpp
index 714aaf844c7..552f44e4546 100644
--- a/devtools/create_engine/create_engine.cpp
+++ b/devtools/create_engine/create_engine.cpp
@@ -31,11 +31,13 @@
 #include <unistd.h>
 #endif
 
-// Specified engine name with different cases
 #define MAX_LINE_LENGTH 256
-char engineUppercase[MAX_LINE_LENGTH];
-char engineCamelcase[MAX_LINE_LENGTH];
-char engineLowercase[MAX_LINE_LENGTH];
+
+// Specified engine name with different cases
+#define MAX_ENGINE_NAME_LENGTH 64
+char engineUppercase[MAX_ENGINE_NAME_LENGTH];
+char engineCamelcase[MAX_ENGINE_NAME_LENGTH];
+char engineLowercase[MAX_ENGINE_NAME_LENGTH];
 
 // List of files to be copied to create engine
 static const char *const FILENAMES[] = {
@@ -107,7 +109,7 @@ void process_file(FILE *in, FILE *out) {
 
 // Copies and processes the specified file
 void process_file(const char *filename, const char *prefix, const char *prefix2) {
-	char srcFilename[128], destFilename[128];
+	char srcFilename[MAX_LINE_LENGTH], destFilename[MAX_LINE_LENGTH];
 	sprintf(srcFilename, "%s/files/%s", prefix2, filename);
 	if (!strncmp(filename, "xyzzy.", 6))
 		sprintf(destFilename, "%s/engines/%s/%s.%s",




More information about the Scummvm-git-logs mailing list