$NetBSD: patch-ab,v 1.5 2000/09/10 22:50:34 wiz Exp $ --- tosha.c.orig Wed May 21 02:11:49 1997 +++ tosha.c @@ -49,7 +49,8 @@ #include #include #include -#include +#include +#include "scsi.h" extern int errno; /* @@ -93,7 +94,7 @@ #include "getlopt.h" typedef unsigned char byte; -typedef unsigned long ulong; +/*typedef unsigned long ulong;*/ struct scsireq *sreq; /* SCSI device request structure */ int scsifd; /* SCSI device file descriptor */ @@ -182,7 +183,8 @@ char *tracklstr = "1-100"; char *outname = "track%02d.pcm"; -char *device = "/dev/cd0c"; +char device_store[256]; +char *device = device_store; int indexonly = FALSE; int quiet = FALSE; int verbose = FALSE; @@ -464,6 +466,8 @@ int singlefile = FALSE; int modechange = TRUE, denschange = 0; + (void) snprintf(device, 256, "/dev/rcd0%c", getrawpartition() + 'a'); + utils_init (argv[0]); #ifdef DEBUG fprintf (stderr, "%s: DEBUG mode is ON.\n", me); @@ -647,7 +651,8 @@ fprintf (stderr, " Reading ...\r"); } else { - asprintf (&ofname, outname, i+1); + ofname = malloc(1000); /* XXX */ + sprintf (ofname, outname, i+1); if (!quiet) fprintf (stderr, verbose ? " (output file: %s)\n" :