add compile-time check for correct DHCP packet size
[oweals/busybox.git] / e2fsprogs / mke2fs.c
index 22e4d2578dc71ff3af7c4ba6fb5d1b7e30788532..1c4f1541e315cc5e86b6657e681d3b5e52e6f274 100644 (file)
@@ -1,3 +1,4 @@
+/* vi: set sw=4 ts=4: */
 /*
  * mke2fs.c - Make a ext2fs filesystem.
  *
@@ -176,9 +177,9 @@ static void mke2fs_error_msg_and_die(int retval, const char *fmt, ...)
 
        if (retval) {
                va_start(ap, fmt);
-               bb_fprintf(stderr,"\nCould not ");
-               bb_vfprintf(stderr, fmt, ap);
-               bb_fprintf(stderr, "\n");
+               fprintf(stderr,"\nCould not ");
+               vfprintf(stderr, fmt, ap);
+               fprintf(stderr, "\n");
                va_end(ap);
                exit(EXIT_FAILURE);
        }
@@ -191,7 +192,7 @@ static void mke2fs_verbose(const char *fmt, ...)
 
        if (!quiet) {
                va_start(ap, fmt);
-               bb_vfprintf(stdout, fmt, ap);
+               vfprintf(stdout, fmt, ap);
                fflush(stdout);
                va_end(ap);
        }
@@ -209,9 +210,9 @@ static void mke2fs_warning_msg(int retval, char *fmt, ... )
 
        if (retval) {
                va_start(ap, fmt);
-               bb_fprintf(stderr,"\nWarning: ");
-               bb_vfprintf(stderr, fmt, ap);
-               bb_fprintf(stderr, "\n");
+               fprintf(stderr,"\nWarning: ");
+               vfprintf(stderr, fmt, ap);
+               fprintf(stderr, "\n");
                va_end(ap);
        }
 }
@@ -225,7 +226,7 @@ static void read_bb_file(ext2_filsys fs, badblocks_list *bb_list,
        FILE            *f;
        errcode_t       retval;
 
-       f = bb_xfopen(bad_blocks_file, "r");
+       f = xfopen(bad_blocks_file, "r");
        retval = ext2fs_read_bb_FILE(fs, f, bb_list, invalid_block);
        fclose (f);
        mke2fs_error_msg_and_die(retval, "read bad blocks from list");
@@ -246,7 +247,7 @@ static void test_disk(ext2_filsys fs, badblocks_list *bb_list)
        mke2fs_verbose("Running command: %s\n", buf);
        f = popen(buf, "r");
        if (!f) {
-               bb_perror_msg_and_die("Could not run '%s'", buf);
+               bb_perror_msg_and_die("cannot run '%s'", buf);
        }
        retval = ext2fs_read_bb_FILE(fs, f, bb_list, invalid_block);
        pclose(f);
@@ -400,7 +401,7 @@ static errcode_t zero_blocks(ext2_filsys fs, blk_t blk, int num,
        }
        /* Allocate the zeroizing buffer if necessary */
        if (!buf) {
-               buf = xcalloc(fs->blocksize, STRIDE_LENGTH);
+               buf = xzalloc(fs->blocksize * STRIDE_LENGTH);
        }
        /* OK, do the write loop */
        next_update = 0;
@@ -691,7 +692,7 @@ static void parse_extended_opts(struct ext2_super_block *sb_param,
        char    *buf, *token, *next, *p, *arg;
        int     r_usage = 0;
 
-       buf = bb_xstrdup(opts);
+       buf = xstrdup(opts);
        for (token = buf; token && *token; token = next) {
                p = strchr(token, ',');
                next = 0;
@@ -736,7 +737,7 @@ static void parse_extended_opts(struct ext2_super_block *sb_param,
                        }
                        if (resize <= sb_param->s_blocks_count) {
                                bb_error_msg("The resize maximum must be greater "
-                                            "than the filesystem size");
+                                               "than the filesystem size");
                                r_usage++;
                                continue;
                        }
@@ -840,7 +841,7 @@ static int PRS(int argc, char *argv[])
 #endif
 
        /* If called as mkfs.ext3, create a journal inode */
-       if (last_char_is(bb_applet_name, '3'))
+       if (last_char_is(applet_name, '3'))
                journal_size = -1;
 
        while ((c = getopt (argc, argv,
@@ -1331,7 +1332,7 @@ int mke2fs_main (int argc, char *argv[])
                        retval = zero_blocks(fs, start, blocks - start,
                                             NULL, &ret_blk, NULL);
 
-               mke2fs_warning_msg(retval, "could not zero block %u at end of filesystem", ret_blk);
+               mke2fs_warning_msg(retval, "cannot zero block %u at end of filesystem", ret_blk);
                write_inode_tables(fs);
                create_root_dir(fs);
                create_lost_and_found(fs);