X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfdump.c;h=d65e625091dc94a52dffd02f6947a7f61d4fc43e;hb=fe0bf96d27b7af11538533b4df9eca5cbc96eedf;hp=2967d917229f068288f04c0425cf94a9a90901b7;hpb=4b9a72751a65ec7002c2468a0791a9cce7f9e32d;p=swftools.git diff --git a/src/swfdump.c b/src/swfdump.c index 2967d91..d65e625 100644 --- a/src/swfdump.c +++ b/src/swfdump.c @@ -343,6 +343,35 @@ void dumpFont(TAG*tag, char*prefix) swf_Shape2Free(shape); free(shape); } + + /* + not part of the file + + printf("%sencoding table:", prefix, prefix); + char filled0=0, lastfilled=0; + for(t=0;tmaxascii;t++) { + if((t&15)==0) { + printf("\n%s%08x ", prefix, t); + int s; + if(!filled0 && t) { + for(s=t;smaxascii;s++) { + if(font->ascii2glyph[s]>=0) break; + } + if(s>t+32) { + printf("*"); + t = ((s-16)&~15)-1; + continue; + } + } + filled0 = 0; + for(s=t;smaxascii;s++) { + if(font->ascii2glyph[s]>=0) filled0=1; + } + } + printf("%4d ", font->ascii2glyph[t]); + } + printf("\n");*/ + swf_FontFree(font); } @@ -925,7 +954,7 @@ void dumperror(const char* format, ...) va_list arglist; va_start(arglist, format); - vsprintf(buf, format, arglist); + vsnprintf(buf, sizeof(buf)-1, format, arglist); va_end(arglist); if(!html && !xy) @@ -985,8 +1014,8 @@ int main (int argc,char ** argv) char header[3]; read(f, header, 3); char compressed = (header[0]=='C'); - char isflash = header[0]=='F' && header[1] == 'W' && header[2] == 'S' || - header[0]=='C' && header[1] == 'W' && header[2] == 'S'; + char isflash = (header[0]=='F' && header[1] == 'W' && header[2] == 'S') || + (header[0]=='C' && header[1] == 'W' && header[2] == 'S'); close(f); int fl=strlen(filename);