]> Nishi Git Mirror - dataworks.git/commitdiff
fix stuff
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Wed, 19 Jun 2024 01:13:15 +0000 (01:13 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Wed, 19 Jun 2024 01:13:15 +0000 (01:13 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@359 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

Library/parser.c

index 4aca253a971b0efe8829e8a1240843c7d6af011b..44ef2bb8fb0cadec9ee0626264b0c4b426b00323 100644 (file)
@@ -110,9 +110,13 @@ bool __dw_print_node(struct Node* node, bool top) {
                printf("\"");
                fflush(stdout);
                int i;
-               for(i = 0; node->string[i] != 0; i++){
-                       if(node->string[i] == '"') printf("\\");
-                       printf("%c", node->string[i]);
+               for(i = 0; node->string[i] != 0; i++) {
+                       if(node->string[i] >= 0 && node->string[i] <= 0x1f) {
+                               printf("\\x%02x", node->string[i]);
+                       } else {
+                               if(node->string[i] == '"') printf("\\");
+                               printf("%c", node->string[i]);
+                       }
                        fflush(stdout);
                }
                printf("\"");