Fix warnings on newer gcc
authorJens Axboe <axboe@fb.com>
Tue, 15 Sep 2015 14:48:06 +0000 (08:48 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 15 Sep 2015 14:48:06 +0000 (08:48 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
blkiomon.c
btreplay/btreplay.c

index a895f6525bd287abbeadeb41f04a8621900006ca..f8b0c9dec00c8f221677da65ee1dd3469baf1d5e 100644 (file)
@@ -198,7 +198,7 @@ static struct dstat *blkiomon_find_dstat(struct rb_search *search, __u32 device)
 static struct dstat *blkiomon_get_dstat(__u32 device)
 {
        struct dstat *dstat;
-       struct rb_search search;
+       struct rb_search search = { 0, };
 
        pthread_mutex_lock(&dstat_mutex);
 
index f76227979ebccfedd85ab93a88bbb44ae67da2ec..2a1e1cca0f72c22968466d153789ff3ec0d3a8ab 100644 (file)
@@ -646,7 +646,7 @@ static void find_input_devs(char *idir)
 static void read_map_devs(char *file_name)
 {
        FILE *fp;
-       char *from_dev, *to_dev;
+       char from_dev[256], to_dev[256];
 
        fp = fopen(file_name, "r");
        if (!fp) {
@@ -654,7 +654,7 @@ static void read_map_devs(char *file_name)
                /*NOTREACHED*/
        }
 
-       while (fscanf(fp, "%as %as", &from_dev, &to_dev) == 2) {
+       while (fscanf(fp, "%s %s", from_dev, to_dev) == 2) {
                struct map_dev *mdp = malloc(sizeof(*mdp));
 
                mdp->from_dev = from_dev;