Fix some vvp initialization problems found with cppcheck.

This patch adds a few missing initializations to various constructors
in the vvp directory. It also enhances the array alias code to copy
more values from the aliased array.
This commit is contained in:
Cary R
2010-10-14 17:48:12 -07:00
committed by Stephen Williams
parent eb525b6c2a
commit 225ee65c31
9 changed files with 95 additions and 55 deletions
+4 -1
View File
@@ -79,7 +79,10 @@ static void my_getrusage(struct rusage *a)
perror("/proc/self/statm");
return;
}
if (3<=fscanf(statm, "%u%u%u", &siz, &rss, &shd)) {
/* Given that these are in pages we'll limit the value to
* what will fit in a 32 bit integer to prevent undefined
* behavior in fscanf(). */
if (3 == fscanf(statm, "%9u %9u %9u", &siz, &rss, &shd)) {
a->ru_maxrss = page_size * siz;
a->ru_idrss = page_size * rss;
a->ru_ixrss = page_size * shd;