From 5b821a81fc7c9ed7decfe5575a867ab82464b0cc Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Fri, 26 Mar 2004 03:22:11 +0000 Subject: "" svn path=/trunk/; revision=1480 --- externals/grill/flext/source/flatom_pr.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'externals/grill/flext/source/flatom_pr.cpp') diff --git a/externals/grill/flext/source/flatom_pr.cpp b/externals/grill/flext/source/flatom_pr.cpp index 2e35f89c..9d5eeb29 100644 --- a/externals/grill/flext/source/flatom_pr.cpp +++ b/externals/grill/flext/source/flatom_pr.cpp @@ -18,34 +18,38 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include #include +#ifdef _MSC_VER +#define snprintf _snprintf +#endif + // \TODO take bufsz into account! bool flext::PrintAtom(const t_atom &a,char *buf,int bufsz) { bool ok = true; if(IsFloat(a)) { - STD::sprintf(buf,"%g",GetFloat(a)); + STD::snprintf(buf,bufsz,"%g",GetFloat(a)); } else if(IsInt(a)) { - STD::sprintf(buf,"%i",GetInt(a)); + STD::snprintf(buf,bufsz,"%i",GetInt(a)); } else if(IsSymbol(a)) { if(!FLEXT_ASSERT(GetSymbol(a))) *buf = 0; else - STD::strcpy(buf,GetString(a)); + STD::strncpy(buf,GetString(a),bufsz); } else if(IsPointer(a)) { - STD::sprintf(buf,"%p",GetPointer(a)); + STD::snprintf(buf,bufsz,"%p",GetPointer(a)); } #if FLEXT_SYS == FLEXT_SYS_PD else if(a.a_type == A_DOLLAR) { - STD::sprintf(buf,"$%d",a.a_w.w_index); + STD::snprintf(buf,bufsz,"$%d",a.a_w.w_index); } else if(a.a_type == A_DOLLSYM) { - STD::sprintf(buf,"$%s",GetString(a)); + STD::snprintf(buf,bufsz,"$%s",GetString(a)); } #elif FLEXT_SYS == FLEXT_SYS_MAX else if(a.a_type == A_DOLLAR) { - STD::sprintf(buf,"$%d",a.a_w.w_long); + STD::snprintf(buf,bufsz,"$%d",a.a_w.w_long); } #else //#pragma message("Not implemented") @@ -74,11 +78,6 @@ bool flext::PrintList(int argc,const t_atom *argv,char *buf,int bufsz) return ok; } -bool flext::AtomList::Print(char *buffer,int buflen) const -{ - return flext::PrintList(Count(),Atoms(),buffer,buflen); -} - bool flext::ScanAtom(t_atom &a,const char *buf) { -- cgit v1.2.1