summaryrefslogtreecommitdiffstats
path: root/src/format.c
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2011-07-26 14:37:15 -0400
committerNalin Dahyabhai <nalin@redhat.com>2011-07-26 14:37:15 -0400
commit6276d3ca35392d9813e4cf96168533a7c65e5af5 (patch)
tree58c8676c4813e7c47fd891c2ce550d202a80a9fb /src/format.c
parent0eb39062b1d44745cc1d0f1ded5a6a5e8ed4ddc6 (diff)
- fix counting, there
Diffstat (limited to 'src/format.c')
-rw-r--r--src/format.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/format.c b/src/format.c
index 598fbce..9b1bb2d 100644
--- a/src/format.c
+++ b/src/format.c
@@ -766,12 +766,12 @@ format_add_choice(struct format_choice **choices, char *offset,
{
struct format_choice *choice;
int i;
- if (values != NULL) {
+ if ((values != NULL) && (*values != NULL)) {
choice = malloc(sizeof(*choice));
if (choice != NULL) {
choice->offset = offset;
choice->next = NULL;
- for (i = 0; values[i] != NULL; i++) {
+ for (i = 0; (*values)[i] != NULL; i++) {
continue;
}
choice->n_values = i;