From cdaae370de9c2971b9e423c1d1310b7131a9a61b Mon Sep 17 00:00:00 2001 From: Renge Date: Fri, 18 Feb 2022 23:11:14 -0500 Subject: [PATCH] fix: return error code when met unexpected chars --- hw1/src/argo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw1/src/argo.c b/hw1/src/argo.c index 62e1c0c..412c9b3 100644 --- a/hw1/src/argo.c +++ b/hw1/src/argo.c @@ -227,7 +227,7 @@ int argo_read_string(ARGO_STRING *s, FILE *f) { if (argo_is_control(c)) { - print_error_helper(); + return print_error_helper(); } if (c == '"') { @@ -270,7 +270,7 @@ int argo_read_string(ARGO_STRING *s, FILE *f) c = argo_get_next_char(f); if (!argo_is_hex(c)) { - print_error_helper(); + return print_error_helper(); } if (argo_is_digit(c)) {