summaryrefslogtreecommitdiffstats
path: root/apps/plugins/pdbox
diff options
context:
space:
mode:
authorWincent Balin <wincent@rockbox.org>2009-08-04 13:52:43 +0000
committerWincent Balin <wincent@rockbox.org>2009-08-04 13:52:43 +0000
commit7996e773340698a6d8c7bcdc465b8a9245f65601 (patch)
tree71d9f0d790cda97f7d9f9e23877007c72c96c4ed /apps/plugins/pdbox
parent28fbb49c0bfe44142eb36b3891d4d28021a1b277 (diff)
downloadrockbox-7996e773340698a6d8c7bcdc465b8a9245f65601.tar.gz
rockbox-7996e773340698a6d8c7bcdc465b8a9245f65601.tar.bz2
rockbox-7996e773340698a6d8c7bcdc465b8a9245f65601.zip
PDBox: Use correct values of maximal string size for snprintf.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22154 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pdbox')
-rw-r--r--apps/plugins/pdbox/PDa/src/g_all_guis.c13
-rw-r--r--apps/plugins/pdbox/PDa/src/g_array.c2
-rw-r--r--apps/plugins/pdbox/PDa/src/g_canvas.c10
-rw-r--r--apps/plugins/pdbox/PDa/src/g_editor.c2
-rw-r--r--apps/plugins/pdbox/PDa/src/g_graph.c4
-rw-r--r--apps/plugins/pdbox/PDa/src/g_template.c2
-rw-r--r--apps/plugins/pdbox/PDa/src/g_text.c2
-rw-r--r--apps/plugins/pdbox/PDa/src/m_atom.c4
-rw-r--r--apps/plugins/pdbox/PDa/src/m_binbuf.c12
-rw-r--r--apps/plugins/pdbox/PDa/src/m_fixed.c2
10 files changed, 25 insertions, 28 deletions
diff --git a/apps/plugins/pdbox/PDa/src/g_all_guis.c b/apps/plugins/pdbox/PDa/src/g_all_guis.c
index 165c9ac14f..c2002a7a4d 100644
--- a/apps/plugins/pdbox/PDa/src/g_all_guis.c
+++ b/apps/plugins/pdbox/PDa/src/g_all_guis.c
@@ -203,8 +203,8 @@ t_symbol *iemgui_new_dogetname(t_iemgui *iemgui, int indx, t_atom *argv)
{
char str[80];
#ifdef ROCKBOX
- snprintf(str, sizeof(str)-1,
- "%d", (int)atom_getintarg(indx, 100000, argv));
+ snprintf(str, sizeof(str), "%d",
+ (int) atom_getintarg(indx, 100000, argv));
#else
sprintf(str, "%d", (int)atom_getintarg(indx, 100000, argv));
#endif
@@ -623,8 +623,7 @@ int iemgui_dialog(t_iemgui *iemgui, t_symbol **srl, int argc, t_atom *argv)
else if(IS_A_FLOAT(argv,7))
{
#ifdef ROCKBOX
- snprintf(str, sizeof(str)-1,
- "%d", (int)atom_getintarg(7, argc, argv));
+ snprintf(str, sizeof(str), "%d", (int) atom_getintarg(7, argc, argv));
#else
sprintf(str, "%d", (int)atom_getintarg(7, argc, argv));
#endif
@@ -635,8 +634,7 @@ int iemgui_dialog(t_iemgui *iemgui, t_symbol **srl, int argc, t_atom *argv)
else if(IS_A_FLOAT(argv,8))
{
#ifdef ROCKBOX
- snprintf(str, sizeof(str)-1,
- "%d", (int)atom_getintarg(8, argc, argv));
+ snprintf(str, sizeof(str), "%d", (int) atom_getintarg(8, argc, argv));
#else
sprintf(str, "%d", (int)atom_getintarg(8, argc, argv));
#endif
@@ -647,8 +645,7 @@ int iemgui_dialog(t_iemgui *iemgui, t_symbol **srl, int argc, t_atom *argv)
else if(IS_A_FLOAT(argv,9))
{
#ifdef ROCKBOX
- snprintf(str, sizeof(str)-1,
- "%d", (int)atom_getintarg(9, argc, argv));
+ snprintf(str, sizeof(str), "%d", (int) atom_getintarg(9, argc, argv));
#else
sprintf(str, "%d", (int)atom_getintarg(9, argc, argv));
#endif
diff --git a/apps/plugins/pdbox/PDa/src/g_array.c b/apps/plugins/pdbox/PDa/src/g_array.c
index b6870b6117..c98e640e94 100644
--- a/apps/plugins/pdbox/PDa/src/g_array.c
+++ b/apps/plugins/pdbox/PDa/src/g_array.c
@@ -150,7 +150,7 @@ t_garray *graph_array(t_glist *gl, t_symbol *s, t_symbol *templatesym,
{
char buf[40];
#ifdef ROCKBOX
- snprintf(buf, sizeof(buf)-1, "array%d", ++gcount);
+ snprintf(buf, sizeof(buf), "array%d", ++gcount);
#else
sprintf(buf, "array%d", ++gcount);
#endif
diff --git a/apps/plugins/pdbox/PDa/src/g_canvas.c b/apps/plugins/pdbox/PDa/src/g_canvas.c
index 19c10474c1..fde19461d0 100644
--- a/apps/plugins/pdbox/PDa/src/g_canvas.c
+++ b/apps/plugins/pdbox/PDa/src/g_canvas.c
@@ -94,8 +94,8 @@ static void glist_doupdatewindowlist(t_glist *gl, char *sbuf)
{
char tbuf[1024];
#ifdef ROCKBOX
- snprintf(tbuf, sizeof(tbuf)-1,
- "{%s .x%x} ", gl->gl_name->s_name, (t_int)canvas);
+ snprintf(tbuf, sizeof(tbuf),
+ "{%s .x%x} ", gl->gl_name->s_name, (t_int) canvas);
#else /* ROCKBOX */
sprintf(tbuf, "{%s .x%x} ", gl->gl_name->s_name, (t_int)canvas);
#endif /* ROCKBOX */
@@ -483,7 +483,7 @@ t_glist *glist_addglist(t_glist *g, t_symbol *sym,
{
char buf[40];
#ifdef ROCKBOX
- snprintf(buf, sizeof(buf)-1, "graph%d", ++gcount);
+ snprintf(buf, sizeof(buf), "graph%d", ++gcount);
#else /* ROCKBOX */
sprintf(buf, "graph%d", ++gcount);
#endif /* ROCKBOX */
@@ -712,7 +712,7 @@ static t_editor *editor_new(t_glist *owner)
x->e_deleted = binbuf_new();
x->e_glist = owner;
#ifdef ROCKBOX
- snprintf(buf, sizeof(buf)-1, ".x%x", (t_int)owner);
+ snprintf(buf, sizeof(buf), ".x%x", (t_int)owner);
#else /* ROCKBOX */
sprintf(buf, ".x%x", (t_int)owner);
#endif /* ROCKBOX */
@@ -1237,7 +1237,7 @@ static void *table_new(t_symbol *s, t_floatarg f)
char tabname[255];
t_symbol *t = gensym("table");
#ifdef ROCKBOX
- snprintf(tabname, sizeof(tabname)-1, "%s%d", t->s_name, tabcount++);
+ snprintf(tabname, sizeof(tabname), "%s%d", t->s_name, tabcount++);
#else /* ROCKBOX */
sprintf(tabname, "%s%d", t->s_name, tabcount++);
#endif /* ROCKBOX */
diff --git a/apps/plugins/pdbox/PDa/src/g_editor.c b/apps/plugins/pdbox/PDa/src/g_editor.c
index a5cce20e10..0b3e348c90 100644
--- a/apps/plugins/pdbox/PDa/src/g_editor.c
+++ b/apps/plugins/pdbox/PDa/src/g_editor.c
@@ -1481,7 +1481,7 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av)
{
char buf[3];
#ifdef ROCKBOX
- snprintf(buf, sizeof(buf)-1, "%c", (int)(av[1].a_w.w_float));
+ snprintf(buf, sizeof(buf), "%c", (int) (av[1].a_w.w_float));
#else /* ROCKBOX */
sprintf(buf, "%c", (int)(av[1].a_w.w_float));
#endif /* ROCKBOX */
diff --git a/apps/plugins/pdbox/PDa/src/g_graph.c b/apps/plugins/pdbox/PDa/src/g_graph.c
index a3d1798733..cccf8823eb 100644
--- a/apps/plugins/pdbox/PDa/src/g_graph.c
+++ b/apps/plugins/pdbox/PDa/src/g_graph.c
@@ -90,7 +90,7 @@ void glist_delete(t_glist *x, t_gobj *y)
{
char tag[80];
#ifdef ROCKBOX
- snprintf(tag, sizeof(tag)-1, "graph%x", (int)gl);
+ snprintf(tag, sizeof(tag), "graph%x", (int) gl);
#else /* ROCKBOX */
sprintf(tag, "graph%x", (int)gl);
#endif /* ROCKBOX */
@@ -687,7 +687,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
rtext_erase(glist_findrtext(parent_glist, &x->gl_obj));
#ifdef ROCKBOX
- snprintf(tag, sizeof(tag)-1, "graph%x", (int) x);
+ snprintf(tag, sizeof(tag), "graph%x", (int) x);
#else
sprintf(tag, "graph%x", (int)x);
#endif
diff --git a/apps/plugins/pdbox/PDa/src/g_template.c b/apps/plugins/pdbox/PDa/src/g_template.c
index deb47c3129..413b7284c1 100644
--- a/apps/plugins/pdbox/PDa/src/g_template.c
+++ b/apps/plugins/pdbox/PDa/src/g_template.c
@@ -929,7 +929,7 @@ static void numbertocolor(int n, char *s)
blue = ((n / 10) % 10);
green = n % 10;
#ifdef ROCKBOX
- snprintf(s, 8, "#%2.2x%2.2x%2.2x",
+ snprintf(s, 10, "#%2.2x%2.2x%2.2x",
rangecolor(red), rangecolor(blue), rangecolor(green));
#else
sprintf(s, "#%2.2x%2.2x%2.2x", rangecolor(red), rangecolor(blue),
diff --git a/apps/plugins/pdbox/PDa/src/g_text.c b/apps/plugins/pdbox/PDa/src/g_text.c
index 98b3fb74f8..ab9f93d80f 100644
--- a/apps/plugins/pdbox/PDa/src/g_text.c
+++ b/apps/plugins/pdbox/PDa/src/g_text.c
@@ -712,7 +712,7 @@ static void gatom_key(void *z, t_floatarg f)
redraw:
/* LATER figure out how to avoid creating all these symbols! */
#ifdef ROCKBOX
- snprintf(sbuf, sizeof(sbuf)-1, "%s...", x->a_buf);
+ snprintf(sbuf, sizeof(sbuf), "%s...", x->a_buf);
#else /* ROCKBOX */
sprintf(sbuf, "%s...", x->a_buf);
#endif
diff --git a/apps/plugins/pdbox/PDa/src/m_atom.c b/apps/plugins/pdbox/PDa/src/m_atom.c
index 4d30c1b3de..e49c6ae478 100644
--- a/apps/plugins/pdbox/PDa/src/m_atom.c
+++ b/apps/plugins/pdbox/PDa/src/m_atom.c
@@ -134,10 +134,10 @@ void atom_string(t_atom *a, char *buf, unsigned int bufsize)
}
break;
case A_DOLLAR:
- snprintf(buf, bufsize-1, "$%d", a->a_w.w_index);
+ snprintf(buf, bufsize, "$%d", a->a_w.w_index);
break;
case A_DOLLSYM:
- snprintf(buf, bufsize-1, "$%s", a->a_w.w_symbol->s_name);
+ snprintf(buf, bufsize, "$%s", a->a_w.w_symbol->s_name);
break;
default:
bug("atom_string");
diff --git a/apps/plugins/pdbox/PDa/src/m_binbuf.c b/apps/plugins/pdbox/PDa/src/m_binbuf.c
index 224d269559..28620bfd22 100644
--- a/apps/plugins/pdbox/PDa/src/m_binbuf.c
+++ b/apps/plugins/pdbox/PDa/src/m_binbuf.c
@@ -325,7 +325,7 @@ void binbuf_addbinbuf(t_binbuf *x, t_binbuf *y)
break;
case A_DOLLAR:
#ifdef ROCKBOX
- snprintf(tbuf, sizeof(tbuf)-1, "$%d", ap->a_w.w_index);
+ snprintf(tbuf, sizeof(tbuf), "$%d", ap->a_w.w_index);
#else /* ROCKBOX */
sprintf(tbuf, "$%d", ap->a_w.w_index);
#endif /* ROCKBOX */
@@ -333,7 +333,7 @@ void binbuf_addbinbuf(t_binbuf *x, t_binbuf *y)
break;
case A_DOLLSYM:
#ifdef ROCKBOX
- snprintf(tbuf, sizeof(tbuf)-1, "$%s", ap->a_w.w_symbol->s_name);
+ snprintf(tbuf, sizeof(tbuf), "$%s", ap->a_w.w_symbol->s_name);
#else /* ROCKBOX */
sprintf(tbuf, "$%s", ap->a_w.w_symbol->s_name);
#endif /* ROCKBOX */
@@ -457,14 +457,14 @@ t_symbol *binbuf_realizedollsym(t_symbol *s, int ac, t_atom *av, int tonew)
if (!tonew)
return (0);
#ifdef ROCKBOX
- else snprintf(buf, sizeof(buf)-1, "$%d", argno);
+ else snprintf(buf, sizeof(buf), "$%d", argno);
#else /* ROCKBOX */
else sprintf(buf, "$%d", argno);
#endif /* ROCKBOX */
}
else if (argno == 0)
#ifdef ROCKBOX
- snprintf(buf, sizeof(buf)-1, "%d", canvas_getdollarzero());
+ snprintf(buf, sizeof(buf), "%d", canvas_getdollarzero());
#else /* ROCKBOX */
sprintf(buf, "%d", canvas_getdollarzero());
#endif /* ROCKBOX */
@@ -908,7 +908,7 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd)
{
char buf[100];
#ifdef ROCKBOX
- snprintf(buf, sizeof(buf)-1, "$%d", nextmess[i].a_w.w_index);
+ snprintf(buf, sizeof(buf), "$%d", nextmess[i].a_w.w_index);
#else /* ROCKBOX */
sprintf(buf, "$%d", nextmess[i].a_w.w_index);
#endif /* ROCKBOX */
@@ -918,7 +918,7 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd)
{
char buf[100];
#ifdef ROCKBOX
- snprintf(buf, sizeof(buf)-1, "$%s", nextmess[i].a_w.w_symbol->s_name);
+ snprintf(buf, sizeof(buf), "$%s", nextmess[i].a_w.w_symbol->s_name);
#else /* ROCKBOX */
sprintf(buf, "$%s", nextmess[i].a_w.w_symbol->s_name);
#endif /* ROCKBOX */
diff --git a/apps/plugins/pdbox/PDa/src/m_fixed.c b/apps/plugins/pdbox/PDa/src/m_fixed.c
index 374f92cbca..9e47364bab 100644
--- a/apps/plugins/pdbox/PDa/src/m_fixed.c
+++ b/apps/plugins/pdbox/PDa/src/m_fixed.c
@@ -90,7 +90,7 @@ static void ipod_bang(t_ipod *x)
{
static char sendme[200];
#ifdef ROCKBOX
- snprintf(sendme, sizeof(sendme)-1, "%s bang;\n", x->x_what->s_name);
+ snprintf(sendme, sizeof(sendme), "%s bang;\n", x->x_what->s_name);
SEND_FROM_CORE(sendme);
#else /* ROCKBOX */
sprintf(sendme,"%s bang;\n",x->x_what->s_name);