sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ff99817d48008d70d419d92d7a4e34bac0a35875
parent 645f12432f9cbd75c49ac1a7dd2e28f977cfd27d
Author: Andrew Milkovich <amilkovich@gmail.com>
Date:   Fri, 25 Jan 2013 12:17:46 -0800

fixed a malloc issue in dwmstatus volume display

Diffstat:
Mdwm.suckless.org/dwmstatus/p1c0-dwmstatus-volume.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dwm.suckless.org/dwmstatus/p1c0-dwmstatus-volume.c b/dwm.suckless.org/dwmstatus/p1c0-dwmstatus-volume.c @@ -141,13 +141,13 @@ setvolume(int percent) { char* mkprogressbar(unsigned int size, unsigned int percent) { unsigned int num = ((size-2)*percent)/100; - char *bar = malloc(size); + char *bar = malloc(size+1); if (bar == NULL) { perror("malloc"); exit(1); } bar[0] = '['; - for (int i = 1; i <= num; i++) { + for (int i = 1; i < num+1; i++) { bar[i] = '*'; } for (int i = num+1; i < size-1; i++) {