From af70f03933abf02f218044ccc954417eb0e94663 Mon Sep 17 00:00:00 2001 From: stag019 Date: Fri, 31 Oct 2014 19:01:21 -0400 Subject: [PATCH] A few more small changes to charmap.c. --- src/asm/charmap.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/asm/charmap.c b/src/asm/charmap.c index 00c632f1..4f2aecf4 100644 --- a/src/asm/charmap.c +++ b/src/asm/charmap.c @@ -54,10 +54,14 @@ readUTF8Char(char *destination, char *source) { size = 2; } - else + else if(first != '\0') { size = 1; } + else + { + size = 0; + } strncpy(destination, source, size); destination[size] = 0; return size; @@ -145,7 +149,7 @@ charmap_Convert(char **input) struct Charmap *charmap; char outchar[CHARMAPLENGTH + 1]; - char *input_temp, *buffer; + char *buffer; int i, j, length; if(pCurrentSection && pCurrentSection -> charmap) @@ -157,7 +161,6 @@ charmap_Convert(char **input) charmap = &globalCharmap; } - input_temp = *input; if((buffer = (char *) malloc(strlen(*input))) == NULL) { fatalerror("Not enough memory for buffer"); @@ -195,7 +198,6 @@ charmap_Convert(char **input) } *input += j; } - *input = input_temp; *input = buffer; return length; }