From d9999d4da8184ece8a4c06f5e4cb2ed81caacb7e Mon Sep 17 00:00:00 2001 From: Zeex Date: Fri, 27 Dec 2013 02:31:43 +0700 Subject: [PATCH] Fix compile error with arrays of packed strings This fixes the "possibly non-terminated string" error when declaring an array of packed strings (unpacked strings worked OK). Test code: new x[][] = { !"hello", !"world" }; main() { printf("%s", x[0]); } --- source/compiler/sc2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/compiler/sc2.c b/source/compiler/sc2.c index 6b2776b..47ee51c 100644 --- a/source/compiler/sc2.c +++ b/source/compiler/sc2.c @@ -1868,7 +1868,7 @@ static const unsigned char *packedstring(const unsigned char *lptr,int *flags) else litadd(0); /* add full cell of zeros */ - if (*lptr==',' || *lptr==')' || *lptr=='}' || *lptr==';') + if (*lptr==',' || *lptr==')' || *lptr=='}' || *lptr==';' || *lptr=='\n' || *lptr=='\r') lptr=stringize; /* backtrack to end of last string for closing " */ return lptr; }