ifupdown: save some 100+ bytes of code in addstr()
[oweals/busybox.git] / util-linux / fdisk.c
index 3061f0d8d380604cdde8a593662a8ceab83ab151..bd2f1e87f2fc7bd336a5459e25c45e7a15f87086 100644 (file)
@@ -287,7 +287,7 @@ read_line(void)
        line_ptr = line_buffer;
        if (!fgets(line_buffer, LINE_LENGTH, stdin)) {
                /* error or eof */
-               bb_error_msg_and_die("\ngot EOF - exiting...");
+               bb_error_msg_and_die("\ngot EOF, exiting");
        }
        while (*line_ptr && !isgraph(*line_ptr))
                line_ptr++;
@@ -441,7 +441,7 @@ static const struct systypes i386_sys_types[] = {
        { "\x07" "HPFS/NTFS" },        /* OS/2 IFS, eg, HPFS or NTFS or QNX */
        { "\x0a" "OS/2 Boot Manager" },/* OS/2 Boot Manager */
        { "\x0b" "Win95 FAT32" },
-       { "\x0c" "Win95 FAT32 (LBA)" },/* LBA really is `Extended Int 13h' */
+       { "\x0c" "Win95 FAT32 (LBA)" },/* LBA really is 'Extended Int 13h' */
        { "\x0e" "Win95 FAT16 (LBA)" },
        { "\x0f" "Win95 Ext'd (LBA)" },
        { "\x11" "Hidden FAT12" },
@@ -1053,7 +1053,7 @@ read_extended(int ext)
                if (partitions >= MAXIMUM_PARTS) {
                        /* This is not a Linux restriction, but
                           this program uses arrays of size MAXIMUM_PARTS.
-                          Do not try to `improve' this test. */
+                          Do not try to 'improve' this test. */
                        struct pte *pre = &ptes[partitions-1];
 #ifdef CONFIG_FEATURE_FDISK_WRITABLE
                        printf(_("Warning: deleting partitions after %d\n"),
@@ -1716,7 +1716,7 @@ change_sysid(void)
                        printf(_("Type 0 means free space to many systems\n"
                                   "(but not to Linux). Having partitions of\n"
                                   "type 0 is probably unwise. You can delete\n"
-                                  "a partition using the `d' command.\n"));
+                                  "a partition using the 'd' command.\n"));
                        /* break; */
                }
 
@@ -2277,7 +2277,7 @@ add_partition(int n, int sys)
                if (start > limit)
                        break;
                if (start >= temp+units_per_sector && num_read) {
-                       printf(_("Sector %llu is already allocated\n"), (unsigned long long)temp);
+                       printf(_("Sector %"OFF_FMT" is already allocated\n"), temp);
                        temp = start;
                        num_read = 0;
                }
@@ -2434,7 +2434,7 @@ new_partition(void)
                        }
                        else
                                printf(_("Invalid partition number "
-                                        "for type `%c'\n"), c);
+                                        "for type '%c'\n"), c);
                }
        }
 }
@@ -2534,13 +2534,13 @@ print_buffer(char *pbuffer)
                        printf("0x%03X:", i);
                printf(" %02X", (unsigned char) pbuffer[i]);
                if (l == MAX_PER_LINE - 1) {
-                       printf("\n");
+                       puts("");
                        l = -1;
                }
        }
        if (l > 0)
-               printf("\n");
-       printf("\n");
+               puts("");
+       puts("");
 }
 
 
@@ -2650,7 +2650,7 @@ xselect(void)
                        break;
                case 'q':
                        close(fd);
-                       printf("\n");
+                       puts("");
                        exit(0);
                case 'r':
                        return;
@@ -2771,7 +2771,7 @@ tryprocpt(void)
        char line[100], ptname[100], devname[120], *s;
        int ma, mi, sz;
 
-       procpt = bb_wfopen("/proc/partitions", "r");
+       procpt = fopen_or_warn("/proc/partitions", "r");
 
        while (fgets(line, sizeof(line), procpt)) {
                if (sscanf(line, " %d %d %d %[^\n ]",
@@ -3022,7 +3022,7 @@ int fdisk_main(int argc, char **argv)
                        break;
                case 'q':
                        close(fd);
-                       printf("\n");
+                       puts("");
                        return 0;
                case 's':
 #ifdef CONFIG_FEATURE_SUN_LABEL