From 1a4880344fc7c5457c43115d49725500d12e4b4c Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 4 Jan 2023 22:44:16 +0100 Subject: [PATCH] Update to fcn tprint: allow multiple printouts in a single simulation run, without overwriting the previous printout. --- src/frontend/inpcom.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index fc2637b1a..b22900a99 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -7006,9 +7006,12 @@ static void inp_poly_err(struct card *card) void tprint(struct card *t) { struct card *tmp; - + static int npr; + char outfile[100]; + sprintf(outfile, "tprint-out%d.txt", npr); + npr++; /*debug: print into file*/ - FILE *fd = fopen("tprint-out.txt", "w"); + FILE *fd = fopen(outfile, "w"); for (tmp = t; tmp; tmp = tmp->nextcard) if (*(tmp->line) != '*') fprintf(fd, "%6d %6d %s\n", tmp->linenum_orig, tmp->linenum,