From dbf288bae7b91e39d8c3700152df0a567ef536be Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 11 Oct 2012 19:33:32 +0200 Subject: [PATCH] inpcom.c, fix a bug which was introduced in commit skip-ws, #5/6, unify macro versions, obj not invariant where the SKIP.*back.* macros have been unified FIXME, the check for `\0' in the backwards direction if of course nonsense. These backward functions either shall not check it at all (being optimistic), or they shell check against a start of string pointer. --- src/frontend/inpcom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 5c8fa667b..e9c64cfd6 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1253,7 +1253,7 @@ inp_fix_macro_param_func_paren_io(struct line *begin_card) static char * get_instance_subckt(char *line) { - char *equal_ptr = NULL, *end_ptr = line + strlen(line) - 1, *inst_name_ptr = NULL, *inst_name = NULL; + char *equal_ptr, *end_ptr = line + strlen(line), *inst_name_ptr, *inst_name; char keep = ' '; // see if instance has parameters @@ -1265,7 +1265,7 @@ get_instance_subckt(char *line) keep = *end_ptr; *end_ptr = '\0'; } - inst_name_ptr = skip_back_non_ws(end_ptr) + 1; + inst_name_ptr = skip_back_non_ws(end_ptr - 1) + 1; inst_name = strdup(inst_name_ptr);