diff --git a/src/wtf/wtf.c b/src/wtf/wtf.c index 6f0c096e..9e8dae76 100644 --- a/src/wtf/wtf.c +++ b/src/wtf/wtf.c @@ -472,7 +472,7 @@ static ErrorStr parse_string(WtfReader* ctx, char** dest) char next; int escape = 0; - while(next = peek_char(ctx), ((escape || next != '"') && next != '\0')) { + while(next = *ctx->input, ((escape || next != '"') && next != '\0')) { if(!escape) { if(next == '\\') { escape = 1; @@ -480,7 +480,7 @@ static ErrorStr parse_string(WtfReader* ctx, char** dest) } else { escape = 0; } - advance(ctx); + ctx->input++; } if(next == '\0') { diff --git a/src/wtf/wtf_writer.cpp b/src/wtf/wtf_writer.cpp index 3df7e545..5dfcf1ab 100644 --- a/src/wtf/wtf_writer.cpp +++ b/src/wtf/wtf_writer.cpp @@ -155,9 +155,9 @@ void wtf_write_string(WtfWriter* ctx, const char* string, const char* string_end *ctx->dest += '"'; for (; string < string_end; string++) { if (*string == '\t') { - *ctx->dest += "\\\t"; + *ctx->dest += "\\t"; } else if (*string == '\n') { - *ctx->dest += "\\\n"; + *ctx->dest += "\\n"; } else if (*string == '\"') { *ctx->dest += "\\\""; } else if (*string == '\\') {