Whamcloud - gitweb
build: fix unused/uninitialized variable warnings
[tools/e2fsprogs.git] / misc / mk_hugefiles.c
index 41280f0..7f1be2e 100644 (file)
@@ -188,7 +188,9 @@ static blk64_t get_partition_start(const char *device_name)
        cp = search_sysfs_block(st.st_rdev, path);
        if (!cp)
                return 0;
-       strncat(path, "/start", SYSFS_PATH_LEN-1);
+       if (strlen(path) > SYSFS_PATH_LEN - sizeof("/start"))
+               return 0;
+       strcat(path, "/start");
        f = fopen(path, "r");
        if (!f)
                return 0;
@@ -466,7 +468,7 @@ errcode_t mk_hugefiles(ext2_filsys fs, const char *device_name)
        unsigned long   i;
        ext2_ino_t      dir;
        errcode_t       retval;
-       blk64_t         fs_blocks, part_offset;
+       blk64_t         fs_blocks, part_offset = 0;
        unsigned long   align;
        int             d, dsize;
        char            *t;