diff --git a/ChangeLog b/ChangeLog
index 95578d57a..54425ddf6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,12 @@
============================ Rework-16 ==================================
+
+2005-08-26 Paolo Nenzi
+
+ * src/fronted/dotcards.c: expressions were not parsed correctly, the bug
+ was in the offset from string base: corrected.
+
2005-08-23 Paolo Nenzi
* src/xspice/icm/xtradev/aswitch/cfunc.mod: Added minimum on resistance
diff --git a/src/frontend/dotcards.c b/src/frontend/dotcards.c
index 232b35f8d..30dbd39d0 100644
--- a/src/frontend/dotcards.c
+++ b/src/frontend/dotcards.c
@@ -451,35 +451,35 @@ fixem(char *string)
for (s = string; *s && (*s != ','); s++) ; *s++ = '\0';
for (t = s; *t && (*t != ')'); t++) ; *t = '\0';
if (eq(s, "0")) (void) sprintf(buf, "mag(v(%s))", string + 3);
- else if (eq(string + 2, "0"))
+ else if (eq(string + 3, "0"))
(void) sprintf(buf, "mag(-v(%s))", s);
else (void) sprintf(buf, "mag(v(%s)-v(%s))", string + 3, s);
} else if (ciprefix("vp(", string)) {
for (s = string; *s && (*s != ','); s++) ; *s++ = '\0';
for (t = s; *t && (*t != ')'); t++) ; *t = '\0';
if (eq(s, "0")) (void) sprintf(buf, "ph(v(%s))", string + 3);
- else if (eq(string + 2, "0"))
+ else if (eq(string + 3, "0"))
(void) sprintf(buf, "ph(-v(%s))", s);
else (void) sprintf(buf, "ph(v(%s)-v(%s))", string + 3, s);
} else if (ciprefix("vi(", string)) {
for (s = string; *s && (*s != ','); s++) ; *s++ = '\0';
for (t = s; *t && (*t != ')'); t++) ; *t = '\0';
if (eq(s, "0")) (void) sprintf(buf, "imag(v(%s))", string + 3);
- else if (eq(string + 2, "0"))
+ else if (eq(string + 3, "0"))
(void) sprintf(buf, "imag(-v(%s))", s);
else (void) sprintf(buf, "imag(v(%s)-v(%s))", string + 3, s);
} else if (ciprefix("vr(", string)) {
for (s = string; *s && (*s != ','); s++) ; *s++ = '\0';
for (t = s; *t && (*t != ')'); t++) ; *t = '\0';
if (eq(s, "0")) (void) sprintf(buf, "real(v(%s))", string + 3);
- else if (eq(string + 2, "0"))
+ else if (eq(string + 3, "0"))
(void) sprintf(buf, "real(-v(%s))", s);
else (void) sprintf(buf, "real(v(%s)-v(%s))", string + 3, s);
} else if (ciprefix("vdb(", string)) {
for (s = string; *s && (*s != ','); s++) ; *s++ = '\0';
for (t = s; *t && (*t != ')'); t++) ; *t = '\0';
if (eq(s, "0")) (void) sprintf(buf, "db(v(%s))", string + 4);
- else if (eq(string + 2, "0"))
+ else if (eq(string + 4, "0"))
(void) sprintf(buf, "db(-v(%s))", s);
else (void) sprintf(buf, "db(v(%s)-v(%s))", string + 4, s);
} else if (ciprefix("i(", string)) {