From 15ad2db8fc4e608d05e87d4d447cb0a5f1081c95 Mon Sep 17 00:00:00 2001 From: Johann Glaser Date: Mon, 18 Mar 2013 20:58:47 +0100 Subject: [PATCH] fixed a crash when lines start with whitespace --- kernel/register.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/register.cc b/kernel/register.cc index ebb834c8f..a61548b64 100644 --- a/kernel/register.cc +++ b/kernel/register.cc @@ -132,7 +132,7 @@ void Pass::extra_args(std::vector args, size_t argidx, RTLIL::Desig void Pass::call(RTLIL::Design *design, std::string command) { std::vector args; - char *s = strdup(command.c_str()), *saveptr; + char *s = strdup(command.c_str()), *sstart = s, *saveptr; s += strspn(s, " \t\r\n"); if (*s == 0 || *s == '#') return; @@ -160,7 +160,7 @@ void Pass::call(RTLIL::Design *design, std::string command) } else args.push_back(str); } - free(s); + free(sstart); call(design, args); } -- 2.30.2