Browse code

uxnasm: reset scope to avoid pointing at garbage

Sigrid Solveig Haflínudóttir authored on 08/11/2021 17:51:14
Showing 1 changed files
... ...
@@ -329,6 +329,7 @@ pass1(FILE *f)
329 329
 {
330 330
 	int ccmnt = 0;
331 331
 	char w[64], scope[64], subw[64];
332
+	scope[0] = 0;
332 333
 	while(fscanf(f, "%63s", w) == 1) {
333 334
 		if(skipblock(w, &ccmnt, '(', ')')) continue;
334 335
 		if(slen(w) >= 63)
... ...
@@ -364,6 +365,7 @@ pass2(FILE *f)
364 365
 {
365 366
 	int ccmnt = 0, cmacr = 0;
366 367
 	char w[64], scope[64], subw[64];
368
+	scope[0] = 0;
367 369
 	while(fscanf(f, "%63s", w) == 1) {
368 370
 		if(w[0] == '%') continue;
369 371
 		if(w[0] == '&') continue;