Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions config11/config11.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#define RANK_LNT 34

Expand Down Expand Up @@ -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;
/* Remove trailing newline if present */
if (inp[strlen(inp)-1] == '\n') inp[strlen(inp)-1] = '\0';
if (*inp == 0) break;
for (cp = inp; *cp != 0; cp++) *cp = toupper (*cp);
for (rank = 0; rank < RANK_LNT; rank++) {
Expand All @@ -75,7 +80,9 @@ for ( ;; ) {
printf ("\n");
continue; }
printf ("Number:\t");
gets (inp);
if (fgets (inp, sizeof(inp), stdin) == NULL) continue;
/* Remove trailing newline if present */
if (inp[strlen(inp)-1] == '\n') inp[strlen(inp)-1] = '\0';
errno = 0;
num = strtoul (inp, &ocp, 10);
if (errno || (inp == ocp)) {
Expand All @@ -101,7 +108,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];
}
Expand Down
2 changes: 1 addition & 1 deletion converters/asc/asc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions converters/decsys/decsys.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

int main (int argc, char *argv[])
{
int i, j, k, word;
int i, k, word;
char *ppos, oname[256];
int fill[256] = { 0 };
FILE *ifile, *ofile;
Expand All @@ -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) {
Expand All @@ -55,7 +55,7 @@ for (i = 1; i < argc; i++) {

printf ("Processing file %s\n", argv[i]);
fwrite (fill, sizeof (int), 256, ofile);
for (j = 0;; j++) {
for (;;) {
k = fscanf (ifile, "%d", &word);
if (k == EOF) break;
// printf ("%06o\n", word);
Expand Down
2 changes: 1 addition & 1 deletion converters/dtos8cvt/dtos8cvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions converters/gt7cvt/gt7cvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#define FLPSIZ 65536
unsigned char fzero[4] = { 0 };

int dump_rec (FILE *of, int bc, char *buf)
int dump_rec (FILE *of, int bc, unsigned char *buf)
{
unsigned char buc[4];

Expand Down Expand Up @@ -62,7 +62,7 @@ if ((argc < 2) || (argv[0] == NULL)) {

for (i = 1; i < argc; i++) {
strcpy (oname, argv[i]);
if (ppos = strrchr (oname, '.')) strcpy (ppos, ".tap");
if ((ppos = strrchr (oname, '.'))) strcpy (ppos, ".tap");
else strcat (oname, ".tap");
ifile = fopen (argv[i], "rb");
if (ifile == NULL) {
Expand Down
13 changes: 11 additions & 2 deletions converters/hpconvert/hpconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ 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;
size_t i;
int cyl, from_cyl, to_cyl, remap;
int platter, cylinder_size, hole_size;


Expand Down Expand Up @@ -247,7 +248,15 @@ int main (int argc,

/* Generate a temporary filename for the converted image. */

name_out = tmpnam (NULL);
char temp_template[] = "/tmp/hpconvert_XXXXXX";
int temp_fd = mkstemp(temp_template);
if (temp_fd == -1) {
puts ("Error: cannot generate a temporary filename.");
fclose (fin);
return 1;
}
close(temp_fd);
name_out = temp_template;

if (name_out == NULL) {
puts ("Error: cannot generate a temporary filename.");
Expand Down
2 changes: 1 addition & 1 deletion converters/indent/indent.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if ((argc < 2) || (argv[0] == NULL)) {

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], "ra");
if (ifile == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion converters/littcvt/littcvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if ((argc < 2) || (argv[0] == NULL)) {

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) {
Expand Down
2 changes: 2 additions & 0 deletions converters/m8376/m8376.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ 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");
Expand Down
2 changes: 1 addition & 1 deletion converters/mt2tpc/mt2tpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if (argc < 2) {

for (i = 1; i < argc; i++) {
strcpy (oname, argv[i]);
if (ppos = strrchr (oname, '.')) strcpy (ppos, ".tpc");
if ((ppos = strrchr (oname, '.'))) strcpy (ppos, ".tpc");
else strcat (oname, ".tpc");
ifile = fopen (argv[i], "rb");
if (ifile == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion converters/mtcvt23/mtcvtv23.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if ((argc < 2) || (argv[0] == NULL)) {

for (i = 1; i < argc; i++) {
strcpy (oname, argv[i]);
if (ppos = strrchr (oname, '.')) strcpy (ppos, ".tap");
if ((ppos = strrchr (oname, '.'))) strcpy (ppos, ".tap");
else strcat (oname, ".tap");
ifile = fopen (argv[i], "rb");
if (ifile == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion converters/mtcvtfix/mtcvtfix.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if ((argc < 2) || (argv[0] == NULL)) {

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) {
Expand Down
2 changes: 1 addition & 1 deletion converters/mtcvtodd/mtcvtodd.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if ((argc < 2) || (argv[0] == NULL)) {

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) {
Expand Down
4 changes: 2 additions & 2 deletions converters/noff/noff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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, ".new");
if ((ppos = strrchr (oname, '.'))) strcpy (ppos, ".new");
else strcat (oname, ".new");
ifile = fopen (argv[i], "ra");
if (ifile == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion converters/sfmtcvt/sfmtcvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ 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");
if ((ppos = strrchr (oname, '.'))) strcpy (ppos, ".bin");
else strcat (oname, ".bin");
ofile = fopen (oname, "wb");
if (ofile == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion converters/strrem/strrem.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if ((argc < 2) || (argv[0] == NULL)) {
slen = strlen (srem);
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], "r");
if (ifile == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion converters/strsub/strsub.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ rmvlen = strlen (rmv);
ins = argv[2];
for (i = 3; 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], "r");
if (ifile == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion converters/tar2mt/tar2mt.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <string.h>
#include <errno.h>

main (int argc, char **argv)
int main (int argc, char **argv)
{
FILE *fIn = NULL, *fOut = NULL;
size_t blocksize = 8192, bytes_read;
Expand Down
2 changes: 1 addition & 1 deletion converters/tp512cvt/tp512cvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if ((argc < 2) || (argv[0] == NULL)) {

for (i = 1; i < argc; i++) {
strcpy (oname, argv[i]);
if (ppos = strrchr (oname, '.')) strcpy (ppos, ".tap");
if ((ppos = strrchr (oname, '.'))) strcpy (ppos, ".tap");
else strcat (oname, ".tap");
ifile = fopen (argv[i], "rb");
if (ifile == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion converters/tpc2mt/tpc2mt.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if (argc < 2) {

for (i = 1; i < argc; i++) {
strcpy (oname, argv[i]);
if (ppos = strrchr (oname, '.')) strcpy (ppos, ".tap");
if ((ppos = strrchr (oname, '.'))) strcpy (ppos, ".tap");
else strcat (oname, ".tap");
ifile = fopen (argv[i], "rb");
if (ifile == NULL) {
Expand Down
Loading