From edc5b5a4d4d1ed90b0269cc87b42a4b3c0d4baba Mon Sep 17 00:00:00 2001 From: dwarning Date: Mon, 16 Mar 2020 11:25:35 +0100 Subject: [PATCH] VDMOS prevent fault if thermal switch is given but thermal nodes are not --- src/frontend/inpcom.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 31b5a4f6e..fa3520eab 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -6969,12 +6969,19 @@ static int inp_vdmos_model(struct card *deck) else if (curr_line[0] == 'm' && strstr(curr_line, "thermal")) { for (i = 0; i < 7; i++) curr_line = nexttok(curr_line); - if (!ciprefix("thermal", curr_line)) { + if ((curr_line == 0) || (strlen(curr_line) < 1)) { fprintf(cp_err, - "Error: We need exactly 5 nodes\n" - " drain, gate, source, tjunction, tcase\n" - " in VDMOS instance line with thermal model\n" - " %s\n", card->line); + "Error: We need exactly 5 nodes\n" + " drain, gate, source, tjunction, tcase\n" + " in VDMOS instance line with thermal model\n" + " %s\n", card->line); + return 1; + } + if (!cieq("thermal", curr_line)) { + fprintf(cp_err, + "Error: Correct flag to activate \n" + " VDMOS thermal model is \"thermal\"\n" + " %s\n", card->line); return 1; } }