From: Nikolas Garofil Date: Thu, 12 Nov 2009 20:48:15 +0000 (+0100) Subject: fix potential bugs in snprintf X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=e26c9977f21ff960a40a2c1f5863d653f03ce09c;p=monky fix potential bugs in snprintf --- diff --git a/src/proc.c b/src/proc.c index 029dc5d..1873ffd 100644 --- a/src/proc.c +++ b/src/proc.c @@ -181,7 +181,7 @@ void print_pid_environ_list(struct text_object *obj, char *p, int p_max_size) buf[i-1] = ';'; } buf[i-1] = 0; - snprintf(p, p_max_size, buf); + snprintf(p, p_max_size, "%s", buf); free(buf); fclose(infofile); } else { @@ -200,7 +200,7 @@ void print_pid_readlink(struct text_object *obj, char *p, int p_max_size) memset(buf, 0, p_max_size); if(readlink(obj->data.s, buf, p_max_size) >= 0) { - snprintf(p, p_max_size, buf); + snprintf(p, p_max_size, "%s", buf); } else { NORM_ERR(READERR, obj->data.s); }