summaryrefslogtreecommitdiff
path: root/converters/bbcim/patches/patch-af
blob: 681d7c00da3dd6cb548dea9f39125ef03dd896c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
$NetBSD: patch-af,v 1.1.1.1 2000/06/07 19:05:21 skrll Exp $

--- intersplits.c.orig	Mon Jun 30 11:36:21 1997
+++ intersplits.c	Sun Jun  4 16:57:25 2000
@@ -9,7 +9,6 @@
 
 void interss(int argc, char *argv[], int options) {
   char  side0[50],  side1[50], interleaved[50]; 
-  char option2[5];
   unsigned char byte;
   FILE *fp0, *fp1, *fp_inter;
   int sec_per_track, track, i;
@@ -20,21 +19,26 @@
     #ifdef NL
     printf("Single density (sd) of double density (dd)?");
     #else
-    printf("Single density (sd) or double density (dd)?");
+    printf("Single density (sd) or double density (dd)?\n");
     #endif
-    scanf("%2s", option2);
-  } else {strcpy(option2, argv[1+options]); options++;}
-
-  if (!strcmp(option2, "dd")) dd=1;
-
+    exit(1);
+  } else {
+    if (!strcmp(argv[1+options], "dd")) {
+      dd=1;
+      options++;
+    } else if (!strcmp(argv[1+options], "sd")) {
+      dd=0;
+      options++;
+    }
+  }
 
   if ((argc-options)==1) {
     #ifdef NL
     printf("Naam van het diskbeeld voor zijde 0?");
     #else
-    printf("Name of the disk image for side 0?");
+    printf("Name of the disk image for side 0?\n");
     #endif
-    scanf("%50s", side0);
+    exit(1);
   } else strcpy(side0, argv[1+options]);
 
 
@@ -42,9 +46,9 @@
     #ifdef NL
     printf("Naam van het diskbeeld voor zijde 1?");
     #else
-    printf("Name of the disk image for side 1?");
+    printf("Name of the disk image for side 1?\n");
     #endif
-    scanf("%50s", side1);
+    exit(1);
   } else strcpy(side1, argv[2+options]);
 
 
@@ -52,9 +56,9 @@
     #ifdef NL
     printf("Naam van om-en-om beeld?");
     #else
-    printf("Name of the interleaved diskimage?");
+    printf("Name of the interleaved diskimage?\n");
     #endif
-    scanf("%50s", interleaved);
+    exit(1);
   } else strcpy(interleaved, argv[3+options]);
 
 
@@ -64,7 +68,7 @@
     #ifdef NL
     printf("Bestand %s is niet te openen\n\n", side0);
     #else
-    printf("File %s cannot be opened\n\n", side0);
+    printf("File %s cannot be opened\n", side0);
     #endif
     exit(1);
   }
@@ -76,7 +80,7 @@
       #ifdef NL
       printf("Bestand %s is niet te openen\n\n", side1);
       #else
-      printf("File %s cannot be opened\n\n", side1);
+      printf("File %s cannot be opened\n", side1);
       #endif
       exit(1);
     }
@@ -130,7 +134,6 @@
 
 void splitds(int argc, char *argv[], int options) {
   char  side0[50],  side1[50], interleaved[50]; 
-  char option2[5];
   unsigned char byte;
   FILE *fp0, *fp1, *fp_inter;
   int sec_per_track, track;
@@ -141,21 +144,26 @@
     #ifdef NL
     printf("Single density (sd) of double density (dd)?");
     #else
-    printf("Single density (sd) or double density (dd)?");
+    printf("Single density (sd) or double density (dd)?\n");
     #endif
-    scanf("%2s", option2);
-  } else {strncpy(option2, argv[1+options],2); options++;}
-
-  if (!strcmp(option2, "dd")) dd=1;
-
+    exit(1);
+  } else {
+    if (!strcmp(argv[1+options], "dd")) {
+      dd=1;
+      options++;
+    } else if (!strcmp(argv[1+options], "sd")) {
+      dd=0;
+      options++;
+    }
+  }
 
   if ((argc-options)==1) {
     #ifdef NL
     printf("Naam van de om-en-om diskdump?");
     #else
-    printf("Name of the interleaved diskdump?");
+    printf("Name of the interleaved diskdump?\n");
     #endif
-    scanf("%50s", interleaved);
+    exit(1);
   } else strcpy(interleaved, argv[1+options]);
 
   strcpy(side0, interleaved);