aboutsummaryrefslogtreecommitdiff
path: root/interpreter/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'interpreter/print.c')
-rw-r--r--interpreter/print.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/interpreter/print.c b/interpreter/print.c
index 78976c2..d410ba2 100644
--- a/interpreter/print.c
+++ b/interpreter/print.c
@@ -9,7 +9,7 @@
#include "mem.h"
void print_token(token* tk) {
- char c;
+ char c = NULL;
switch (tk->kind) {
case TOKEN_SEMICOLON: c = ';'; break;
case TOKEN_COLON: c = ':'; break;
@@ -28,7 +28,8 @@ void print_token(token* tk) {
printf("%d", *((int*) tk->var));
return;
}
- printf("%c", c);
+ if (c)
+ printf("%c", c);
}
void print_token_list(token_list* list) {