From 24cfab4c610bf59d19416a33c734e617465d140c Mon Sep 17 00:00:00 2001 From: jessica parsons Date: Thu, 19 Feb 2026 02:19:58 -0800 Subject: [PATCH] in external_codefmt expand special characters into res, NOT src --- main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 54f51da..635adf1 100644 --- a/main.c +++ b/main.c @@ -125,13 +125,13 @@ external_codefmt(char *src, int len, char *lang) x = strlen(res); for ( i=0; i < len; i++ ) { switch (src[i]) { - case '&': strcpy(&src[x], "&"); + case '&': strcpy(&res[x], "&"); x += 5 /*strlen(&)*/ ; break; - case '<': strcpy(&src[x], "<"); + case '<': strcpy(&res[x], "<"); x += 4 /*strlen(<)*/ ; break; - case '>': strcpy(&src[x], ">"); + case '>': strcpy(&res[x], ">"); x += 4 /*strlen(>)*/ ; break; default: res[x++] = src[i];