diff options
author | Joe Mistachkin <joe@mistachkin.com> | 2003-05-10 07:42:26 (GMT) |
---|---|---|
committer | Joe Mistachkin <joe@mistachkin.com> | 2003-05-10 07:42:26 (GMT) |
commit | 082fa29b145dc4b55095de62ee4b8c9ba4398af9 (patch) | |
tree | d5acbe31815e2bd0553276bc5e7671bea8ad7f9f /tools/encoding/txt2enc.c | |
parent | 25f83ef2a02cc439021fe8298a5539e90374b3bd (diff) | |
download | tcl-082fa29b145dc4b55095de62ee4b8c9ba4398af9.zip tcl-082fa29b145dc4b55095de62ee4b8c9ba4398af9.tar.gz tcl-082fa29b145dc4b55095de62ee4b8c9ba4398af9.tar.bz2 |
fix for [Bug 733221]
Diffstat (limited to 'tools/encoding/txt2enc.c')
-rw-r--r-- | tools/encoding/txt2enc.c | 15 |
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; } |