bc: convert to "G trick" - this returns bc to zero bss increase
[oweals/busybox.git] / util-linux / fdisk_sun.c
index e7fcc067cd87a2cc92565f4aacbcd4eee258b5f3..3697a69b95dda6d8b013ded3c7c49ddb0f580248 100644 (file)
@@ -348,6 +348,7 @@ create_sunlabel(void)
 
        set_all_unchanged();
        set_changed(0);
+       check_sun_label();
        get_boot(CREATE_EMPTY_SUN);
 }
 
@@ -497,11 +498,14 @@ add_sun_partition(int n, int sys)
                else
                        first = read_int(scround(start), scround(stop)+1,
                                         scround(stop), 0, mesg);
-               if (display_in_cyl_units)
+               if (display_in_cyl_units) {
                        first *= units_per_sector;
-               else
+               } else {
                        /* Starting sector has to be properly aligned */
-                       first = (first + g_heads * g_sectors - 1) / (g_heads * g_sectors);
+                       first = (first + g_heads * g_sectors - 1) /
+                               (g_heads * g_sectors);
+                       first *= g_heads * g_sectors;
+               }
                if (n == 2 && first != 0)
                        printf("\
 It is highly recommended that the third partition covers the whole disk\n\
@@ -602,7 +606,7 @@ sun_change_sysid(int i, int sys)
                        "there may destroy your partition table and bootblock.\n"
                        "Type YES if you're very sure you would like that partition\n"
                        "tagged with 82 (Linux swap): ");
-               if (strcmp (line_ptr, "YES\n"))
+               if (strcmp(line_ptr, "YES") != 0)
                        return;
        }
        switch (sys) {