diff --git a/config11/config11.c b/config11/config11.c index 3b6c0f1..229436c 100644 --- a/config11/config11.c +++ b/config11/config11.c @@ -24,6 +24,7 @@ in this Software without prior written authorization from Robert M Supnik. */ +#include #include #include #include @@ -57,12 +58,16 @@ char *namtab[RANK_LNT] = { int main (int argc, char *argv[]) { +(void) argc; +(void) argv; + for ( ;; ) { for (i = 0; i < RANK_LNT; i++) numctl[i] = 0; printf ("Enter configuration data\n"); for ( ;; ) { printf ("Name:\t"); - if (gets (inp) == NULL) return 0; + if (fgets (inp, sizeof (inp), stdin) == NULL) return 0; + for (cp = inp; *cp != 0; cp++) if (*cp == '\r' || *cp == '\n') *cp = '\0'; if (*inp == 0) break; for (cp = inp; *cp != 0; cp++) *cp = toupper (*cp); for (rank = 0; rank < RANK_LNT; rank++) { @@ -75,7 +80,7 @@ for ( ;; ) { printf ("\n"); continue; } printf ("Number:\t"); - gets (inp); + fgets (inp, sizeof (inp), stdin); errno = 0; num = strtoul (inp, &ocp, 10); if (errno || (inp == ocp)) { @@ -101,7 +106,7 @@ for ( ;; ) { for (j = 1; j < numctl[i]; j++) { printf ("\t\t %d\t%06o\n", j + 1, csr); csr = (csr + modtab[i] + 1) & ~modtab[i]; } - printf (" %\t\tgap\t%06o\n", csr); + printf (" %%\t\tgap\t%06o\n", csr); } if ((i + 1) < RANK_LNT) csr = (csr + modtab[i+1] + 1) & ~modtab[i+1]; } diff --git a/converters/asc/asc.c b/converters/asc/asc.c index 44630f0..5532f37 100644 --- a/converters/asc/asc.c +++ b/converters/asc/asc.c @@ -71,7 +71,7 @@ else mode = MD_WIN; for (i = 1; i < argc; i++) { strcpy (oname, argv[i]); - if (ppos = strrchr (oname, '.')) strcpy (ppos, ".new"); + if ((ppos = strrchr (oname, '.'))) strcpy (ppos, ".new"); else strcat (oname, ".new"); ifile = fopen (argv[i], "rb"); if (ifile == NULL) { diff --git a/converters/decsys/decsys.c b/converters/decsys/decsys.c index ac12d34..5eba4cc 100644 --- a/converters/decsys/decsys.c +++ b/converters/decsys/decsys.c @@ -42,7 +42,7 @@ if ((argc < 2) || (argv[0] == NULL)) { for (i = 1; i < argc; i++) { strcpy (oname, argv[i]); - if (ppos = strrchr (oname, '.')) strcpy (ppos, ".dtp"); + if ((ppos = strrchr (oname, '.'))) strcpy (ppos, ".dtp"); else strcat (oname, ".dtp"); ifile = fopen (argv[i], "r"); if (ifile == NULL) { diff --git a/converters/dtos8cvt/dtos8cvt.c b/converters/dtos8cvt/dtos8cvt.c index 8a0b4c0..0d6b495 100644 --- a/converters/dtos8cvt/dtos8cvt.c +++ b/converters/dtos8cvt/dtos8cvt.c @@ -42,7 +42,7 @@ if ((argc < 2) || (argv[0] == NULL)) { for (i = 1; i < argc; i++) { strcpy (oname, argv[i]); - if (ppos = strrchr (oname, '.')) strcpy (ppos, ".dt8"); + if ((ppos = strrchr (oname, '.'))) strcpy (ppos, ".dt8"); else strcat (oname, ".dt8"); ifile = fopen (argv[i], "rb"); if (ifile == NULL) { diff --git a/converters/fsio/fsio.c b/converters/fsio/fsio.c index 57017a4..435888a 100644 --- a/converters/fsio/fsio.c +++ b/converters/fsio/fsio.c @@ -638,12 +638,12 @@ static struct mountedFS *findMount( uint8_t unitpresent = 0; unsigned int i; char *endptr, *ptr; - char origdev[32]; + char origdev[33]; if ((ptr = strchr(dev, ':')) != NULL) { *ptr++ = '\0'; - strncpy(origdev, dev, sizeof(origdev)); + strncpy(origdev, dev, sizeof(origdev)-1); /* * Determine validity of the device name and whether a unit number is diff --git a/converters/hpconvert/hpconvert.c b/converters/hpconvert/hpconvert.c index 93d8ff5..b42a717 100644 --- a/converters/hpconvert/hpconvert.c +++ b/converters/hpconvert/hpconvert.c @@ -173,8 +173,9 @@ int main (int argc, char sig_fwd [SIGNATURE_SIZE], sig_rev [SIGNATURE_SIZE]; char hold, cylinder [CYLINDER_SIZE]; bool identified = false, reversed = false, debug = false; - int i, cyl, from_cyl, to_cyl, remap; + int cyl, from_cyl, to_cyl, remap; int platter, cylinder_size, hole_size; + unsigned long i; /* Read the disc image filename. */ diff --git a/converters/indent/indent.c b/converters/indent/indent.c index 03760f1..5cc8217 100644 --- a/converters/indent/indent.c +++ b/converters/indent/indent.c @@ -45,8 +45,10 @@ if ((argc < 2) || (argv[0] == NULL)) { for (i = 1; i < argc; i++) { strcpy (oname, argv[i]); - if (ppos = strrchr (oname, '.')) strcpy (ppos, ".new"); - else strcat (oname, ".new"); + if ((ppos = strrchr (oname, '.'))) + strcpy (ppos, ".new"); + else + strcat (oname, ".new"); ifile = fopen (argv[i], "ra"); if (ifile == NULL) { printf ("Error opening file: %s\n", argv[i]); diff --git a/converters/littcvt/littcvt.c b/converters/littcvt/littcvt.c index 617d1ca..b2b4761 100644 --- a/converters/littcvt/littcvt.c +++ b/converters/littcvt/littcvt.c @@ -44,8 +44,10 @@ if ((argc < 2) || (argv[0] == NULL)) { for (i = 1; i < argc; i++) { strcpy (oname, argv[i]); - if (ppos = strrchr (oname, '.')) strcpy (ppos, ".new"); - else strcat (oname, ".new"); + if ((ppos = strrchr (oname, '.'))) + strcpy (ppos, ".new"); + else + strcat (oname, ".new"); ifile = fopen (argv[i], "rb"); if (ifile == NULL) { printf ("Error opening file: %s\n", argv[i]); diff --git a/converters/m8376/m8376.c b/converters/m8376/m8376.c index 48ac147..9af6a2c 100644 --- a/converters/m8376/m8376.c +++ b/converters/m8376/m8376.c @@ -38,6 +38,9 @@ char fname[256]; int c, i, j; unsigned int wd[1024]; +(void) argc; +(void) argv; + for (i = 0; i < 8; i++) { sprintf (fname, "C:\\temp\\m8376\\m8376e%03d.bin", fnum[i]); fi[i] = fopen (fname, "rb"); diff --git a/converters/mt2tpc/mt2tpc.c b/converters/mt2tpc/mt2tpc.c index 8bf4acf..f820c9e 100644 --- a/converters/mt2tpc/mt2tpc.c +++ b/converters/mt2tpc/mt2tpc.c @@ -46,8 +46,10 @@ if (argc < 2) { for (i = 1; i < argc; i++) { strcpy (oname, argv[i]); - if (ppos = strrchr (oname, '.')) strcpy (ppos, ".tpc"); - else strcat (oname, ".tpc"); + if ((ppos = strrchr (oname, '.'))) + strcpy (ppos, ".tpc"); + else + strcat (oname, ".tpc"); ifile = fopen (argv[i], "rb"); if (ifile == NULL) { printf ("Error opening file: %s\n", argv[i]); diff --git a/converters/mtcvt23/mtcvtv23.c b/converters/mtcvt23/mtcvtv23.c index 3b150c5..da927c1 100644 --- a/converters/mtcvt23/mtcvtv23.c +++ b/converters/mtcvt23/mtcvtv23.c @@ -43,8 +43,10 @@ if ((argc < 2) || (argv[0] == NULL)) { for (i = 1; i < argc; i++) { strcpy (oname, argv[i]); - if (ppos = strrchr (oname, '.')) strcpy (ppos, ".tap"); - else strcat (oname, ".tap"); + if ((ppos = strrchr (oname, '.'))) + strcpy (ppos, ".tap"); + else + strcat (oname, ".tap"); ifile = fopen (argv[i], "rb"); if (ifile == NULL) { printf ("Error opening file: %s\n", argv[i]); diff --git a/converters/mtcvtfix/mtcvtfix.c b/converters/mtcvtfix/mtcvtfix.c index bc0f922..cae0b29 100644 --- a/converters/mtcvtfix/mtcvtfix.c +++ b/converters/mtcvtfix/mtcvtfix.c @@ -45,8 +45,10 @@ if ((argc < 2) || (argv[0] == NULL)) { for (i = 1; i < argc; i++) { strcpy (oname, argv[i]); - if (ppos = strrchr (oname, '.')) strcpy (ppos, ".new"); - else strcat (oname, ".new"); + if ((ppos = strrchr (oname, '.'))) + strcpy (ppos, ".new"); + else + strcat (oname, ".new"); ifile = fopen (argv[i], "rb"); if (ifile == NULL) { printf ("Error opening file: %s\n", argv[i]); diff --git a/converters/mtcvtodd/mtcvtodd.c b/converters/mtcvtodd/mtcvtodd.c index e00c357..1dfce2c 100644 --- a/converters/mtcvtodd/mtcvtodd.c +++ b/converters/mtcvtodd/mtcvtodd.c @@ -43,8 +43,10 @@ if ((argc < 2) || (argv[0] == NULL)) { for (i = 1; i < argc; i++) { strcpy (oname, argv[i]); - if (ppos = strrchr (oname, '.')) strcpy (ppos, ".new"); - else strcat (oname, ".new"); + if ((ppos = strrchr (oname, '.'))) + strcpy (ppos, ".new"); + else + strcat (oname, ".new"); ifile = fopen (argv[i], "rb"); if (ifile == NULL) { printf ("Error opening file: %s\n", argv[i]); diff --git a/converters/noff/noff.c b/converters/noff/noff.c index 1234050..ec2b8c7 100644 --- a/converters/noff/noff.c +++ b/converters/noff/noff.c @@ -33,7 +33,7 @@ int main (int argc, char *argv[]) { int i, c, ffc; -char *ppos, oline[256], oname[256]; +char *ppos, oname[256]; FILE *ifile, *ofile; if ((argc < 2) || (argv[0] == NULL)) { @@ -42,8 +42,10 @@ if ((argc < 2) || (argv[0] == NULL)) { for (i = 1; i < argc; i++) { strcpy (oname, argv[i]); - if (ppos = strrchr (oname, '.')) strcpy (ppos, ".new"); - else strcat (oname, ".new"); + if ((ppos = strrchr (oname, '.'))) + strcpy (ppos, ".new"); + else + strcat (oname, ".new"); ifile = fopen (argv[i], "ra"); if (ifile == NULL) { printf ("Error opening file: %s\n", argv[i]); diff --git a/converters/sfmtcvt/sfmtcvt.c b/converters/sfmtcvt/sfmtcvt.c index d558d44..ad68fb5 100644 --- a/converters/sfmtcvt/sfmtcvt.c +++ b/converters/sfmtcvt/sfmtcvt.c @@ -97,8 +97,10 @@ for (i = 1, numf = 0; i < argc; i++) { maxaddr[0], k, maxaddr[k]); return 0; } } strcpy (oname, argv[i]); - if (ppos = strrchr (oname, '.')) strcpy (ppos, ".bin"); - else strcat (oname, ".bin"); + if ((ppos = strrchr (oname, '.'))) + strcpy (ppos, ".bin"); + else + strcat (oname, ".bin"); ofile = fopen (oname, "wb"); if (ofile == NULL) { printf ("Error opening file: %s\n", oname);