1
0
mirror of https://gitlab.xiph.org/xiph/icecast-common.git synced 2024-12-04 14:46:31 -05:00

Allow a NULL filename in log_set_filename, since it's allowed elsewhere.

Thanks Coverity!


svn path=/icecast/trunk/log/; revision=10971
This commit is contained in:
Michael Smith 2006-03-07 19:07:20 +00:00
parent 7cd4e78bd8
commit 8d771bc2d6

View File

@ -198,7 +198,8 @@ int log_set_filename(int id, const char *filename)
{ {
if (id < 0 || id >= LOG_MAXLOGS) if (id < 0 || id >= LOG_MAXLOGS)
return LOG_EINSANE; return LOG_EINSANE;
if (!strcmp(filename, "") || loglist [id] . in_use == 0) /* NULL filename is ok, empty filename is not. */
if ((filename && !strcmp(filename, "")) || loglist [id] . in_use == 0)
return LOG_EINSANE; return LOG_EINSANE;
_lock_logger(); _lock_logger();
if (loglist [id] . filename) if (loglist [id] . filename)