[Scummvm-git-logs] scummvm-tools master -> 1c744df988b7316f49f757d830b4d72ce5773483

sev- noreply at scummvm.org
Mon Oct 24 19:20:08 UTC 2022


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

Summary:
86d859d0d8 HADESCH: Fix error message
1c744df988 HADESCH: Switch to Common::String


Commit: 86d859d0d837087aec8ec379ffa76949896c71e3
    https://github.com/scummvm/scummvm-tools/commit/86d859d0d837087aec8ec379ffa76949896c71e3
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-10-24T21:20:05+02:00

Commit Message:
HADESCH: Fix error message

Changed paths:
    engines/hadesch/extract_hadesch.cpp


diff --git a/engines/hadesch/extract_hadesch.cpp b/engines/hadesch/extract_hadesch.cpp
index baf8bf61..db437b3d 100644
--- a/engines/hadesch/extract_hadesch.cpp
+++ b/engines/hadesch/extract_hadesch.cpp
@@ -75,7 +75,7 @@ int main (int argc, char **argv) {
 		int csz = READ_LE_UINT32(headptr+12);
 		fout = fopen(fn, "wb");
 		if (fout == NULL) {
-			fprintf (stderr, "Unable to open %s: %s\n", argv[1], strerror(errno));
+			fprintf (stderr, "Unable to open %s: %s\n", fn, strerror(errno));
 			return -3;
 		}
 		fwrite(buf + cur, csz, 1, fout);
@@ -87,7 +87,7 @@ int main (int argc, char **argv) {
 		sprintf (fn, "%s/tail.bin", argv[2]);
 		fout = fopen(fn, "wb");
 		if (fout == NULL) {
-			fprintf (stderr, "Unable to open %s: %s\n", argv[1], strerror(errno));
+			fprintf (stderr, "Unable to open %s: %s\n", fn, strerror(errno));
 			return -3;
 		}
 		fwrite(buf + cur, sz - cur, 1, fout);


Commit: 1c744df988b7316f49f757d830b4d72ce5773483
    https://github.com/scummvm/scummvm-tools/commit/1c744df988b7316f49f757d830b4d72ce5773483
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-10-24T21:20:05+02:00

Commit Message:
HADESCH: Switch to Common::String

Changed paths:
    Makefile.common
    engines/hadesch/extract_hadesch.cpp


diff --git a/Makefile.common b/Makefile.common
index 27112436..f8970a0c 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -146,7 +146,8 @@ dekyra_OBJS := \
 	$(UTILS)
 
 extract_hadesch_OBJS := \
-	engines/hadesch/extract_hadesch.o
+	engines/hadesch/extract_hadesch.o \
+	$(UTILS)
 
 extract_lokalizator_OBJS := \
 	engines/scumm/extract_lokalizator.o
diff --git a/engines/hadesch/extract_hadesch.cpp b/engines/hadesch/extract_hadesch.cpp
index db437b3d..b91dc95d 100644
--- a/engines/hadesch/extract_hadesch.cpp
+++ b/engines/hadesch/extract_hadesch.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "common/endian.h"
+#include "common/str.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -29,7 +30,6 @@ int main (int argc, char **argv) {
 	unsigned char * buf;
 	size_t sz;
 	FILE *fin;
-	char fn[1024];
 
 	if (argc < 3) {
 		fprintf (stderr, "USAGE: %s INFILE OUTDIR\n", argv[0]);
@@ -70,12 +70,12 @@ int main (int argc, char **argv) {
 		unsigned char * headptr = buf + 16 + 16 * ctr;
 		char c = headptr[12];
 		headptr[12] = 0;
-		sprintf (fn, "%s/%s", argv[2], headptr);
+		Common::String fn = Common::String::format("%s/%s", argv[2], headptr);
 		headptr[12] = c;
 		int csz = READ_LE_UINT32(headptr+12);
-		fout = fopen(fn, "wb");
+		fout = fopen(fn.c_str(), "wb");
 		if (fout == NULL) {
-			fprintf (stderr, "Unable to open %s: %s\n", fn, strerror(errno));
+			fprintf (stderr, "Unable to open %s: %s\n", fn.c_str(), strerror(errno));
 			return -3;
 		}
 		fwrite(buf + cur, csz, 1, fout);
@@ -84,10 +84,10 @@ int main (int argc, char **argv) {
 	}
 
 	if (cur < (int)sz) {
-		sprintf (fn, "%s/tail.bin", argv[2]);
-		fout = fopen(fn, "wb");
+		Common::String fn = Common::String::format("%s/tail.bin", argv[2]);
+		fout = fopen(fn.c_str(), "wb");
 		if (fout == NULL) {
-			fprintf (stderr, "Unable to open %s: %s\n", fn, strerror(errno));
+			fprintf (stderr, "Unable to open %s: %s\n", fn.c_str(), strerror(errno));
 			return -3;
 		}
 		fwrite(buf + cur, sz - cur, 1, fout);




More information about the Scummvm-git-logs mailing list