replace 'noiseless' only if it is an unconnected token

This commit is contained in:
Holger Vogt 2020-07-10 17:59:05 +02:00
parent 3fe4de5b7f
commit 71338c3271
1 changed files with 2 additions and 1 deletions

View File

@ -8112,7 +8112,8 @@ struct card *ltspice_compat(struct card *oldcard)
} }
else if (*cut_line == 'r') { else if (*cut_line == 'r') {
char* noi = strstr(cut_line, "noiseless"); char* noi = strstr(cut_line, "noiseless");
if (noi) { /* only if 'noiseless' is an unconnected token */
if (noi && isspace_c(noi[-1]) && (isspace_c(noi[9]) || !isprint_c(noi[9]))) {
memcpy(noi, "noisy=0 ", 9); memcpy(noi, "noisy=0 ", 9);
} }
} }