Skip to content

Commit 662ceaa

Browse files
committed
Updated 7800basic to v0.29
1 parent 1c1c0e6 commit 662ceaa

File tree

72 files changed

+245
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+245
-155
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions

README.md

Lines changed: 1 addition & 1 deletion

hovers/7800basic.md

Lines changed: 22 additions & 1 deletion

out/bin/compilers/7800basic/7800bas.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern char currentcharset[256];
2222
extern int graphicsdatawidth[16];
2323
extern char charactersetchars[257];
2424

25-
#define BASIC_VERSION_INFO "7800basic v0.28"
25+
#define BASIC_VERSION_INFO "7800basic v0.29"
2626

2727
int main (int argc, char *argv[])
2828
{
@@ -121,19 +121,19 @@ int main (int argc, char *argv[])
121121
printf ("game\n"); // label for start of game
122122
init_includes (path);
123123

124-
statement = (char **) malloc (sizeof (char *) * 200);
124+
statement = (char **) malloc (sizeof (char *) * STATEMENTCOUNT);
125125
deallocate_mem = statement;
126-
for (i = 0; i < 200; ++i)
126+
for (i = 0; i < STATEMENTCOUNT; ++i)
127127
{
128-
statement[i] = (char *) malloc (sizeof (char) * 201);
129-
memset(statement[i],0,201);
128+
statement[i] = (char *) malloc (sizeof (char) * (SIZEOFSTATEMENT+1));
129+
memset(statement[i],0,(SIZEOFSTATEMENT+1));
130130
}
131131

132132
while (1)
133133
{ // clear out statement cache
134-
for (i = 0; i < 200; ++i)
134+
for (i = 0; i < STATEMENTCOUNT; ++i)
135135
{
136-
for (j = 0; j < 200; ++j)
136+
for (j = 0; j < SIZEOFSTATEMENT; ++j)
137137
{
138138
statement[i][j] = '\0';
139139
}
@@ -188,7 +188,8 @@ int main (int argc, char *argv[])
188188
break;
189189
for (j = 0; j < 500; ++j)
190190
finalcode[j] = '\0';
191-
strncpy (finalcode, mycode, strlen (mycode) - strlen (codeadd));
191+
strncpy (finalcode, mycode, 500);
192+
finalcode[(strlen (mycode) - strlen (codeadd))]=0;
192193
strcat (finalcode, defr[i]);
193194
strcat (finalcode, codeadd + strlen (def[i]));
194195
strcpy (mycode, finalcode);
@@ -222,7 +223,7 @@ int main (int argc, char *argv[])
222223
else
223224
{
224225
multiplespace = 0;
225-
if (k < 199) // avoid overrun when users use REM with long horizontal separators
226+
if (k < (SIZEOFSTATEMENT-1)) // avoid overrun when users use REM with long horizontal separators
226227
statement[j][k++] = single;
227228
}
228229

1.25 KB
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)