From c486218e33719025301ae8234988d03c1964d121 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 8 May 2016 19:15:20 +0200 Subject: [PATCH] findsubckt(), cleanup --- src/frontend/numparam/xpressn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index 57a5a6b7a..4555db491 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -556,15 +556,15 @@ findsubckt(dico_t *dico, const char * const s) spice_dstring_init(&ustr); - while (((k_ptr - s) >= 0) && (s[(k_ptr - s)] <= ' ')) + while ((k_ptr >= s) && (*k_ptr <= ' ')) k_ptr--; j_ptr = k_ptr; - while (((k_ptr - s) >= 0) && (s[(k_ptr - s)] > ' ')) + while ((k_ptr >= s) && (*k_ptr > ' ')) k_ptr--; - pscopy_up(&ustr, s, (int) (k_ptr - s) + 1, (int) (j_ptr - s) - (int) (k_ptr - s)); + pscopy_up(&ustr, s, (int) (k_ptr - s) + 1, (int) (j_ptr - k_ptr)); entry = entrynb(dico, spice_dstring_value(&ustr)); if (entry && (entry->tp == NUPA_SUBCKT)) {