From 44a17a14f712595bb718b487dafd7dcbc41e9520 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 18 Nov 2017 17:22:49 +0100 Subject: [PATCH] defsubckt(), cleanup --- src/frontend/numparam/xpressn.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index 4a5b994b3..230271f38 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -516,24 +516,24 @@ defsubckt(dico_t *dico, struct card *card, nupa_type categ) const char *i_ptr, *j_ptr; i_ptr = s; - while (((i_ptr - s) < (ls_ptr - s)) && (s[(i_ptr - s)] != '.')) + while ((i_ptr < ls_ptr) && (*i_ptr != '.')) i_ptr++; /* skip 1st dotword */ - while (((i_ptr - s) < (ls_ptr - s)) && (s[(i_ptr - s)] > ' ')) + while ((i_ptr < ls_ptr) && (*i_ptr > ' ')) i_ptr++; - while (((i_ptr - s) < (ls_ptr - s)) && (s[(i_ptr - s)] <= ' ')) + while ((i_ptr < ls_ptr) && (*i_ptr <= ' ')) i_ptr++; /* skip blank */ j_ptr = i_ptr; - while (((j_ptr - s) < (ls_ptr - s)) && (s[(j_ptr - s)] > ' ')) + while ((j_ptr < ls_ptr) && (*j_ptr > ' ')) j_ptr++; - if ((j_ptr - s) > (i_ptr - s)) { + if (j_ptr > i_ptr) { SPICE_DSTRING ustr; /* temp user string */ spice_dstring_init(&ustr); - pscopy_up(&ustr, s, (int) (i_ptr - s), (int) (j_ptr - s) - (int) (i_ptr - s)); + pscopy_up(&ustr, s, (int) (i_ptr - s), (int) (j_ptr - i_ptr)); err = nupa_define(dico, spice_dstring_value(&ustr), ' ', categ, 0.0, w, NULL); spice_dstring_free(&ustr); } else {