Don't call InvertPixelArray with negative width and/or height.
[tangerine.git] / workbench / c / HDTool / setup.c
blobad2bcaddd1e98ae61216ca5bee7726527a77eb91
1 #include <string.h>
2 #include <stdio.h>
3 #include <proto/dos.h>
4 #include "setup.h"
6 char *setuptemplate = "DEVICE/K/A,UNIT/K/N/A,PARTITION/K,SCRIPT/K";
8 LONG setup(char *name, STRPTR args) {
9 BOOL retval = RETURN_FAIL;
10 IPTR myargs[]={0,0,0,0};
11 struct RDArgs *rdargs;
12 struct RDArgs rda = {{args, strlen(args), 0}, 0, 0, 0, NULL, 0};
14 rda.RDA_Source.CS_Buffer[rda.RDA_Source.CS_Length]='\n';
15 rdargs = ReadArgs(setuptemplate,myargs, &rda);
16 if (rdargs)
18 printf
20 "setup\n\tdevice=%s unit=%ld\n",
21 (STRPTR)myargs[0], *(LONG *)myargs[1]
23 if (myargs[2])
25 printf("\ttable in partition=%s\n", (STRPTR)myargs[2]);
27 else
28 printf("\ttable in whole HD\n");
29 if (myargs[3])
31 printf("\tscipt is %s\n", (STRPTR)myargs[3]);
33 else
34 printf("\tinteractive\n");
35 FreeArgs(rdargs);
37 else
38 PrintFault(IoErr(), name);
39 return retval;