Since C99, string literal concatenation is provided, allowing the number
of printf() calls to be greatly reduced (20 -> 1).

This is my first diff I'm sending, feedback would be very appreciated.

diff --git usr.sbin/fdformat/fdformat.c usr.sbin/fdformat/fdformat.c
index c2566992e..2d6afbd3f 100644
--- usr.sbin/fdformat/fdformat.c
+++ usr.sbin/fdformat/fdformat.c
@@ -132,26 +132,26 @@ verify_track(int fd, int track, int tracksize)
 static void
 usage(void)
 {
-       printf("usage: %s [-nqv] [-c cyls] [-F fillbyte] [-g gap3len] ",
-               __progname);
-       printf("[-h heads]\n");
-       printf("\t[-i intleave] [-r rate] [-S secshft] [-s secs]\n");
-       printf("\t[-t steps_per_track] device_name\n");
-       printf("Options:\n");
-       printf("\t-n\tdon't verify floppy after formatting\n");
-       printf("\t-q\tsuppress any normal output, don't ask for 
confirmation\n");
-       printf("\t-v\tdon't format, verify only\n");
-       printf("\tdevname\tthe full name of floppy device or in short form fd0, 
fd1\n");
-       printf("Obscure options:\n");
-       printf("\t-c #\tspecify number of cylinders, 40 or 80\n");
-       printf("\t-F #\tspecify fill byte\n");
-       printf("\t-g #\tspecify gap length\n");
-       printf("\t-h #\tspecify number of floppy heads, 1 or 2\n");
-       printf("\t-i #\tspecify interleave factor\n");
-       printf("\t-r #\tspecify data rate, 250, 300 or 500 kbps\n");
-       printf("\t-S #\tspecify sector size, 0=128, 1=256, 2=512 bytes\n");
-       printf("\t-s #\tspecify number of sectors per track, 9, 10, 15 or 
18\n");
-       printf("\t-t #\tnumber of steps per track\n");
+       printf("usage: %s [-nqv] [-c cyls] [-F fillbyte] [-g gap3len] "
+           "[-h heads]\n"
+           "   [-i intleave] [-r rate] [-S secshft] [-s secs]\n"
+           "   [-t steps_per_track] device_name\n"
+           "Options:\n"
+           "   -n      don't verify floppy after formatting\n"
+           "   -q      inhibit any normal output, don't ask for confirmation\n"
+           "   -v      don't format, verify only\n"
+           "   devname "
+           "the full name of floppy device or in short form fd0, fd1\n"
+           "Obscure options:\n"
+           "   -c #    specify number of cylinders, 40 or 80\n"
+           "   -F #    specify fill byte\n"
+           "   -g #    specify gap length\n"
+           "   -h #    specify number of floppy heads, 1 or 2\n"
+           "   -i #    specify interleave factor\n"
+           "   -r #    specify data rate, 250, 300 or 500 kbps\n"
+           "   -S #    specify sector size, 0=128, 1=256, 2=512 bytes\n"
+           "   -s #    specify number of sectors per track, 9, 10, 15 or 18\n"
+           "   -t #    number of steps per track\n", __progname);
        exit(2);
 }
 
-- 
Sascha Paunovic <[email protected]>

Reply via email to