mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 05:58:20 +00:00
avoiding using back() for an empty std::string
This commit is contained in:
parent
57fdef573c
commit
10d8c2fe6b
1 changed files with 1 additions and 1 deletions
|
@ -2101,7 +2101,7 @@ void ZAMGen::Emit(EmitTarget et, const string& s)
|
|||
|
||||
fputs(s.c_str(), f);
|
||||
|
||||
if ( s.back() != '\n' && ! no_NL )
|
||||
if ( ! no_NL && (s.empty() || s.back() != '\n') )
|
||||
fputs("\n", f);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue