aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flatom_pr.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2004-03-26 03:22:11 +0000
committerThomas Grill <xovo@users.sourceforge.net>2004-03-26 03:22:11 +0000
commit5b821a81fc7c9ed7decfe5575a867ab82464b0cc (patch)
tree9a5ad718cc024066d53f46937b32dacb64d97e4d /externals/grill/flext/source/flatom_pr.cpp
parent62a9baa7736d938b672a839b88f0bb4c8e511437 (diff)
""
svn path=/trunk/; revision=1480
Diffstat (limited to 'externals/grill/flext/source/flatom_pr.cpp')
-rw-r--r--externals/grill/flext/source/flatom_pr.cpp23
1 files changed, 11 insertions, 12 deletions
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 <string.h>
#include <stdio.h>
+#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)
{