findsubname(), reorder and add some constness

This commit is contained in:
rlar 2017-11-23 18:16:43 +01:00
parent ab152c99fc
commit 4ca87d6b0b
1 changed files with 3 additions and 5 deletions

View File

@ -152,12 +152,10 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p)
/* then truncate s after the last subckt(?) identifier */ /* then truncate s after the last subckt(?) identifier */
{ {
SPICE_DSTRING name; /* extract a name */ SPICE_DSTRING name; /* extract a name */
char *s; /* current dstring */ char * const s = spice_dstring_value(dstr_p);
int k, ls; const int ls = spice_dstring_length(dstr_p);
ls = spice_dstring_length(dstr_p); int k = ls - 1;
s = spice_dstring_value(dstr_p);
k = ls - 1; /* now a C - string */
spice_dstring_init(&name); spice_dstring_init(&name);
while (k >= 0) { while (k >= 0) {