Extra \0 in preprocessed makes string too long

This commit is contained in:
hooper114 2009-08-06 08:53:05 +00:00
parent 0cfcc41bb4
commit 22dec4892c

View File

@ -447,7 +447,7 @@ void to_latin1(unsigned char source[], unsigned char preprocessed[])
j = 0; j = 0;
i = 0; i = 0;
next = 0; next = 0;
do { while (i < input_length) {
if(source[i] < 128) { if(source[i] < 128) {
preprocessed[j] = source[i]; preprocessed[j] = source[i];
j++; j++;
@ -465,7 +465,7 @@ void to_latin1(unsigned char source[], unsigned char preprocessed[])
} }
} }
i = next; i = next;
} while(i < input_length); }
preprocessed[j] = '\0'; preprocessed[j] = '\0';
return; return;