diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-05-11 00:27:59 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-05-11 00:27:59 +0000 |
commit | d786ebb77edb5384f2a0fd679ee3f248717a337c (patch) | |
tree | 68ffdf01bb76ec9fc4e14d942e55f9385128c677 /src/encoding.c | |
parent | c42e6e6d1d04ef45cfb7b30a5363cc3003eb268c (diff) | |
download | ttf2f-d786ebb77edb5384f2a0fd679ee3f248717a337c.tar.gz ttf2f-d786ebb77edb5384f2a0fd679ee3f248717a337c.tar.bz2 |
Fix buffer overflows
svn path=/trunk/tools/ttf2f/; revision=7463
Diffstat (limited to 'src/encoding.c')
-rw-r--r-- | src/encoding.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/encoding.c b/src/encoding.c index b331355..18220c8 100644 --- a/src/encoding.c +++ b/src/encoding.c @@ -35,7 +35,7 @@ ttf2f_result encoding_write(const char *savein, const char *name, fprintf(output, "%% Encoding file for font '%s'\n\n", name); /* Write latin1 first */ - for (i = 0; i != sizeof(ctx->latin1tab); i++) { + for (i = 0; i != N_ELEMENTS(ctx->latin1tab); i++) { if (ctx->latin1tab[i] == NULL) { if (type == ENCODING_TYPE_NORMAL) { fprintf(output, "/.notdef\n"); @@ -56,7 +56,7 @@ ttf2f_result encoding_write(const char *savein, const char *name, ttf2f_poll(1); if (g->done_encoding == 0) { - encoding_write_glyph(i + sizeof(ctx->latin1tab), + encoding_write_glyph(i + N_ELEMENTS(ctx->latin1tab), g, type, output); g->done_encoding = 1; |