(lwpStatus): Fix potential buffer overflow.
This commit is contained in:
parent
75deff7811
commit
a6b5b1d567
1 changed files with 4 additions and 4 deletions
|
@ -46,7 +46,6 @@ lwpStatus(struct lwpProc *proc, char *format, ...)
|
||||||
va_list ap;
|
va_list ap;
|
||||||
static struct timeval startTime;
|
static struct timeval startTime;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
char buf[1024];
|
|
||||||
int sec, msec;
|
int sec, msec;
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
|
@ -60,9 +59,10 @@ lwpStatus(struct lwpProc *proc, char *format, ...)
|
||||||
sec++;
|
sec++;
|
||||||
msec += 1000;
|
msec += 1000;
|
||||||
}
|
}
|
||||||
vsprintf(buf, format, ap);
|
printf("%d:%02d.%03d %17s[%d]: ",
|
||||||
printf("%d:%02d.%03d %17s[%d]: %s\n", sec / 60, sec % 60,
|
sec / 60, sec % 60, msec / 10, proc->name, proc->pri);
|
||||||
msec / 10, proc->name, proc->pri, buf);
|
vprintf(format, ap);
|
||||||
|
putchar('\n');
|
||||||
}
|
}
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue