mirror of
https://github.com/pevans/erc-c.git
synced 2024-12-21 23:29:16 +00:00
Don't write to the log stream if null
This prevents a somewhat vexing crash condition from happening.
This commit is contained in:
parent
7811f4da44
commit
256e0cf1d6
@ -62,6 +62,12 @@ log_write(int level, const char *fmt, ...)
|
|||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
// Oh. Well, we can't write something if we have no log stream,
|
||||||
|
// right?
|
||||||
|
if (log_stream == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
vfprintf(log_stream, fmt, ap);
|
vfprintf(log_stream, fmt, ap);
|
||||||
fprintf(log_stream, "\n");
|
fprintf(log_stream, "\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user