X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fcommon.c;h=2012405308895be4123e278113b6a5964c95e91c;hb=bbad613e3e1bd5c0399c7fcdeeeee7f930a512cb;hp=3417dd0f9cea13f50d9cb215dd6f7fc6eb99a2e3;hpb=b8aa0577aae67db4da5221459102202febc5c103;p=swftools.git diff --git a/lib/as3/common.c b/lib/as3/common.c index 3417dd0..2012405 100644 --- a/lib/as3/common.c +++ b/lib/as3/common.c @@ -1,3 +1,26 @@ +/* common.c + + Routines for handling Flash2 AVM2 ABC Actionscript + + Extension module for the rfxswf library. + Part of the swftools package. + + Copyright (c) 2008,2009 Matthias Kramm + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include #include #include @@ -15,9 +38,10 @@ void as3_error(const char*format, ...) if(as3_verbosity<0) exit(1); va_start(arglist, format); - vsprintf(buf, format, arglist); + vsnprintf(buf, sizeof(buf)-1, format, arglist); va_end(arglist); fprintf(stderr, "%s:%d:%d: error: %s\n", current_filename, current_line, current_column, buf); + fprintf(stderr, "%s\n", current_filename_long); fflush(stderr); exit(1); } @@ -29,7 +53,7 @@ void as3_warning(const char*format, ...) if(as3_verbosity<1) return; va_start(arglist, format); - vsprintf(buf, format, arglist); + vsnprintf(buf, sizeof(buf)-1, format, arglist); va_end(arglist); fprintf(stdout, "%s:%d:%d: warning: %s\n", current_filename, current_line, current_column, buf); fflush(stdout); @@ -42,7 +66,7 @@ void as3_softwarning(const char*format, ...) if(as3_verbosity<2) return; va_start(arglist, format); - vsprintf(buf, format, arglist); + vsnprintf(buf, sizeof(buf)-1, format, arglist); va_end(arglist); fprintf(stderr, "%s:%d:%d: warning: %s\n", current_filename, current_line, current_column, buf); fflush(stderr);