summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Mistachkin <joe@mistachkin.com>2003-05-10 07:43:17 (GMT)
committerJoe Mistachkin <joe@mistachkin.com>2003-05-10 07:43:17 (GMT)
commit80ce402c2de0bb3494b97e738563fb4c94b7311f (patch)
tree0f9e87a716c0f5b0cd4ae2d77021fe5de5825745
parent1a9fd777ca966fd412d3d0149ad3d4529ff76ea7 (diff)
downloadtcl-80ce402c2de0bb3494b97e738563fb4c94b7311f.zip
tcl-80ce402c2de0bb3494b97e738563fb4c94b7311f.tar.gz
tcl-80ce402c2de0bb3494b97e738563fb4c94b7311f.tar.bz2
fix for [Bug 733221]
-rw-r--r--tools/encoding/txt2enc.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/encoding/txt2enc.c b/tools/encoding/txt2enc.c
index 73870bf..7ce85ef 100644
--- a/tools/encoding/txt2enc.c
+++ b/tools/encoding/txt2enc.c
@@ -92,7 +92,7 @@ main(int argc, char **argv)
case 'm':
fixmissing = 0;
break;
-
+
default:
goto usage;
}
@@ -174,7 +174,7 @@ main(int argc, char **argv)
if (enc < 32 || uni < 32) {
continue;
}
-
+
hi = enc >> 8;
lo = enc & 0xff;
if (toUnicode[hi] == NULL) {
@@ -183,7 +183,7 @@ main(int argc, char **argv)
}
toUnicode[hi][lo] = uni;
}
-
+
fclose(fp);
dot = strrchr(argv[argc - 1], '.');
@@ -228,7 +228,7 @@ main(int argc, char **argv)
}
}
printf("%c\n%04X %d %d\n", "SDM"[type], fallbackChar, symbol, used);
-
+
for (hi = 0; hi < 256; hi++) {
if (toUnicode[hi] != NULL) {
printf("%02X\n", hi);
@@ -240,5 +240,12 @@ main(int argc, char **argv)
}
}
}
+
+ for (hi = 0; hi < 256; hi++) {
+ if (toUnicode[hi] != NULL) {
+ free(toUnicode[hi]);
+ toUnicode[hi] = NULL;
+ }
+ }
return 0;
}