From 4ca87d6b0b335f585141042397cd2ed2a5f62939 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 23 Nov 2017 18:16:43 +0100 Subject: [PATCH] findsubname(), reorder and add some constness --- src/frontend/numparam/spicenum.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index dbf488d4b..79fd69365 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -152,12 +152,10 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p) /* then truncate s after the last subckt(?) identifier */ { SPICE_DSTRING name; /* extract a name */ - char *s; /* current dstring */ - int k, ls; + char * const s = spice_dstring_value(dstr_p); + const int ls = spice_dstring_length(dstr_p); - ls = spice_dstring_length(dstr_p); - s = spice_dstring_value(dstr_p); - k = ls - 1; /* now a C - string */ + int k = ls - 1; spice_dstring_init(&name); while (k >= 0) {