Commit 4d78eb8c authored by Gary Wong's avatar Gary Wong

Fix three bugs in Interface::TypeCapability().

interface_type() should actually be called type().
Inadequate quoting in a SQL query.
And assigning through a reference needs an extra '$'.
parent cef5e14d
...@@ -790,16 +790,16 @@ sub TypeCapability($$$) ...@@ -790,16 +790,16 @@ sub TypeCapability($$$)
return -1 return -1
if (!ref($self)); if (!ref($self));
my $itype = $self->interface_type(); my $itype = $self->type();
my $query_result = my $query_result =
DBQueryWarn("select capval from interface_capabilities ". DBQueryWarn("select capval from interface_capabilities ".
"where type='$itype' and capkey=$capkey"); "where type='$itype' and capkey='$capkey'");
return -1 return -1
if (!$query_result || !$query_result->numrows()); if (!$query_result || !$query_result->numrows());
my ($capval) = $query_result->fetchrow_array(); my ($capval) = $query_result->fetchrow_array();
$pcapval = $capval; $$pcapval = $capval;
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment