Fix warning with newer gcc in str_numa_mpol_cb()
authorJens Axboe <axboe@kernel.dk>
Wed, 17 Jul 2013 22:15:31 +0000 (16:15 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 17 Jul 2013 22:15:31 +0000 (16:15 -0600)
GCC complains about potentially accessing the array beyond
the end. Ensure that we include a NULL at the end.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
options.c

index 1ca48017e221f9e42c4debed48f384577a32b913..6462c67c3a92ff7c1a966ef90e33b8814219928f 100644 (file)
--- a/options.c
+++ b/options.c
@@ -550,7 +550,7 @@ static int str_numa_mpol_cb(void *data, char *input)
 {
        struct thread_data *td = data;
        const char * const policy_types[] =
 {
        struct thread_data *td = data;
        const char * const policy_types[] =
-               { "default", "prefer", "bind", "interleave", "local" };
+               { "default", "prefer", "bind", "interleave", "local", NULL };
        int i;
 
        char *nodelist = strchr(input, ':');
        int i;
 
        char *nodelist = strchr(input, ':');