summaryrefslogtreecommitdiff
path: root/kernel/register.cc
diff options
context:
space:
mode:
authorJohann Glaser <Johann.Glaser@gmx.at>2013-03-18 20:58:47 +0100
committerJohann Glaser <Johann.Glaser@gmx.at>2013-03-18 20:58:47 +0100
commit15ad2db8fc4e608d05e87d4d447cb0a5f1081c95 (patch)
treeb16c91b3ec4a6a2f3195f38fe86d95497702150f /kernel/register.cc
parent2192873daa7915aa034e9afd1fe82efbc61320d1 (diff)
fixed a crash when lines start with whitespace
Diffstat (limited to 'kernel/register.cc')
-rw-r--r--kernel/register.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/register.cc b/kernel/register.cc
index ebb834c8..a61548b6 100644
--- a/kernel/register.cc
+++ b/kernel/register.cc
@@ -132,7 +132,7 @@ void Pass::extra_args(std::vector<std::string> args, size_t argidx, RTLIL::Desig
void Pass::call(RTLIL::Design *design, std::string command)
{
std::vector<std::string> 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);
}