Index: apps/plugins/pdbox/PDa/src/m_atom.c =================================================================== --- apps/plugins/pdbox/PDa/src/m_atom.c (revision 21272) +++ apps/plugins/pdbox/PDa/src/m_atom.c (working copy) @@ -3,8 +3,18 @@ * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ #include "m_pd.h" + +#ifdef ROCKBOX +#include "plugin.h" +#define snprintf rb->snprintf +#define strlen rb->strlen +#define strcat rb->strcat +#define strcpy rb->strcpy +#define strncpy rb->strncpy +#else /* ROCKBOX */ #include #include +#endif /* ROCKBOX */ /* convenience routines for checking and getting values of atoms. There's no "pointer" version since there's nothing @@ -23,7 +33,9 @@ t_symbol *atom_getsymbol(t_atom *a) /* LATER think about this more carefully */ { +#ifndef ROCKBOX char buf[30]; +#endif if (a->a_type == A_SYMBOL) return (a->a_w.w_symbol); else return (&s_float); } @@ -33,7 +45,7 @@ char buf[30]; if (a->a_type == A_SYMBOL) return (a->a_w.w_symbol); else if (a->a_type == A_FLOAT) - sprintf(buf, "%g", a->a_w.w_float); + snprintf(buf, 30-1, "%g", a->a_w.w_float); else strcpy(buf, "???"); return (gensym(buf)); } @@ -76,7 +88,7 @@ strcpy(buf, "(pointer)"); break; case A_FLOAT: - sprintf(tbuf, "%g", a->a_w.w_float); + snprintf(tbuf, 30-1, "%g", a->a_w.w_float); if (strlen(tbuf) < bufsize-1) strcpy(buf, tbuf); else if (a->a_w.w_float < 0) strcpy(buf, "-"); else strcat(buf, "+"); @@ -118,10 +130,10 @@ } break; case A_DOLLAR: - sprintf(buf, "$%d", a->a_w.w_index); + snprintf(buf, bufsize-1, "$%d", a->a_w.w_index); break; case A_DOLLSYM: - sprintf(buf, "$%s", a->a_w.w_symbol->s_name); + snprintf(buf, bufsize-1, "$%s", a->a_w.w_symbol->s_name); break; default: bug("atom_string");