mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix warning with attribute string lookup
This commit is contained in:
parent
bbcc4b00fb
commit
b639f1426f
1 changed files with 4 additions and 1 deletions
|
@ -45,7 +45,10 @@ const char* attr_name(AttrTag t) {
|
||||||
};
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
return attr_names[int(t)];
|
if ( int(t) >= 0 && int(t) < NUM_ATTRS )
|
||||||
|
return attr_names[int(t)];
|
||||||
|
else
|
||||||
|
return "<unknown>";
|
||||||
}
|
}
|
||||||
|
|
||||||
Attr::Attr(AttrTag t, ExprPtr e) : expr(std::move(e)) {
|
Attr::Attr(AttrTag t, ExprPtr e) : expr(std::move(e)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue