aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/tads/tads2/line_source_file.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2019-05-22 18:33:34 -0700
committerPaul Gilbert2019-05-24 18:21:07 -0700
commit5381930e8b09f61b8c7969db4a657067586be897 (patch)
tree20cea271def957405b4d1f6dd58ec1a5c70b2c27 /engines/glk/tads/tads2/line_source_file.cpp
parent1a974b9749f2c12edbdf98cbe9f4b6ec9fcba40d (diff)
downloadscummvm-rg350-5381930e8b09f61b8c7969db4a657067586be897.tar.gz
scummvm-rg350-5381930e8b09f61b8c7969db4a657067586be897.tar.bz2
scummvm-rg350-5381930e8b09f61b8c7969db4a657067586be897.zip
GLK: TADS2: Fix uninitialized variable warnings
Diffstat (limited to 'engines/glk/tads/tads2/line_source_file.cpp')
-rw-r--r--engines/glk/tads/tads2/line_source_file.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/glk/tads/tads2/line_source_file.cpp b/engines/glk/tads/tads2/line_source_file.cpp
index 430b1d9767..affc3cd587 100644
--- a/engines/glk/tads/tads2/line_source_file.cpp
+++ b/engines/glk/tads/tads2/line_source_file.cpp
@@ -87,7 +87,7 @@ linfdef *linfini(mcmcxdef *mctx, errcxdef *ec, char *filename,
int i;
objnum *objp;
linfdef *linf;
- osfildef *fp;
+ osfildef *fp = nullptr;
char fbuf[OSFNMAX + 1];
tokpdef fakepath;
int len;
@@ -404,8 +404,8 @@ void linfglop2(lindef *lin, uchar *buf)
int linfwrt(lindef *lin, osfildef *fp)
{
#define linf ((linfdef *)lin)
-#define UCHAR_MAX 255
- uchar buf[UCHAR_MAX + 6];
+#define BYTE_MAX 255
+ uchar buf[BYTE_MAX + 6];
size_t len;
uint pgcnt;
uchar *objp;
@@ -413,7 +413,7 @@ int linfwrt(lindef *lin, osfildef *fp)
buf[0] = lin->linid;
len = strlen(linf->linfnam);
- if (len > UCHAR_MAX)
+ if (len > BYTE_MAX)
return FALSE;
buf[1] = (uchar)len;
oswp4(buf + 2, linf->linfcrec);