Imported Upstream version 2.10
[debian/cpmtools] / fsck.cpm.c
index 572823b1c7ce537466b25d84b3b0585b5d5a937b..c7e9048e44f94900456dc0340af8a47db19fb52d 100644 (file)
@@ -1,17 +1,20 @@
 /* #includes */ /*{{{C}}}*//*{{{*/
+#include "config.h"
+
 #include <assert.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 #include <errno.h>
-#include "config.h"
-
-extern char *optarg;
-extern int optind,opterr,optopt;
-int getopt(int argc, char * const *argv, const char *optstring);
 
+#include "getopt_.h"
 #include "cpmdir.h"
 #include "cpmfs.h"
+
+#ifdef USE_DMALLOC
+#include <dmalloc.h>
+#endif
 /*}}}*/
 /* #defines */ /*{{{*/
 /* your favourite password *:-) */
@@ -585,7 +588,7 @@ int main(int argc, char *argv[])
   }
 
   if (optind!=(argc-1)) usage=1;
-  else image=argv[optind];
+  else image=argv[optind++];
 
   if (usage)
   {