mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 13:57:32 +02:00
frontend/com_let.c, bug fix, "#302 Integer in Let Statement"
let 2foo = someexpression was silently accepted, even though 2foo is an illegal identifier. (first letter is a digit) This was especially irritating, since print 2foo has a legal meaning, 2 femto oO, which is 2e-15 (whatever Unit an oO might be) Reported by Justin Fisher in http://sourceforge.net/p/ngspice/bugs/302/
This commit is contained in:
@@ -123,7 +123,7 @@ com_let(wordlist *wl)
|
|||||||
*++q = '\0';
|
*++q = '\0';
|
||||||
|
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
if (eq(p, "all") ||strchr(p, '@')) {
|
if (eq(p, "all") || strchr(p, '@') || isdigit(*p)) {
|
||||||
fprintf(cp_err, "Error: bad variable name %s\n", p);
|
fprintf(cp_err, "Error: bad variable name %s\n", p);
|
||||||
tfree(p);
|
tfree(p);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user