mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 12:56:37 +02:00
Fixed bug with config file write (crash on FreeBSD)
This commit is contained in:
@@ -810,18 +810,19 @@ config_file_write_line (struct t_config_file *config_file,
|
||||
if (!config_file || !option_name)
|
||||
return;
|
||||
|
||||
va_start (argptr, value);
|
||||
vsnprintf (buf, sizeof (buf) - 1, value, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
if (!buf[0])
|
||||
string_iconv_fprintf (config_file->file, "\n[%s]\n",
|
||||
option_name);
|
||||
else
|
||||
if (value)
|
||||
{
|
||||
va_start (argptr, value);
|
||||
vsnprintf (buf, sizeof (buf) - 1, value, argptr);
|
||||
va_end (argptr);
|
||||
string_iconv_fprintf (config_file->file, "%s = %s\n",
|
||||
option_name, buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
string_iconv_fprintf (config_file->file, "\n[%s]\n",
|
||||
option_name);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user