449 |
|
t->populate(); |
450 |
|
} |
451 |
|
|
452 |
< |
qsort(stats, num_stats, sizeof *stats, stats_compare); |
452 |
> |
if (stats != NULL) |
453 |
> |
qsort(stats, num_stats, sizeof *stats, stats_compare); |
454 |
|
} |
455 |
|
|
456 |
|
/* Print the value of a stat. */ |
536 |
|
else |
537 |
|
compare = stats_compare; |
538 |
|
|
539 |
< |
s = (const stat *)bsearch(&key, stats, num_stats, |
540 |
< |
sizeof *stats, compare); |
539 |
> |
if (stats == NULL) { |
540 |
> |
s = NULL; |
541 |
> |
} else { |
542 |
> |
s = (const stat *)bsearch(&key, stats, |
543 |
> |
num_stats, |
544 |
> |
sizeof *stats, |
545 |
> |
compare); |
546 |
> |
} |
547 |
> |
|
548 |
|
if (s == NULL) { |
549 |
|
printf("Unknown stat %s\n", name); |
550 |
|
continue; |