mirror of
https://github.com/tbamud/tbamud.git
synced 2026-01-30 04:45:17 +01:00
Prevent compiler warnings and potential OLC setting string truncation.
- Prevented compiler warnings when using ’-Wtautological-pointer-compare’ on development system (Darwin) - Prevented possible string truncation when adding a newline to an OLC setting string.
This commit is contained in:
parent
5dc6eae4c5
commit
68fcdb73bf
9 changed files with 18 additions and 19 deletions
6
src/db.c
6
src/db.c
|
|
@ -3915,14 +3915,14 @@ void load_config( void )
|
|||
else if (!str_cmp(tag, "dflt_dir")) {
|
||||
if (CONFIG_DFLT_DIR)
|
||||
free(CONFIG_DFLT_DIR);
|
||||
if (line != NULL && *line)
|
||||
if (*line)
|
||||
CONFIG_DFLT_DIR = strdup(line);
|
||||
else
|
||||
CONFIG_DFLT_DIR = strdup(DFLT_DIR);
|
||||
} else if (!str_cmp(tag, "dflt_ip")) {
|
||||
if (CONFIG_DFLT_IP)
|
||||
free(CONFIG_DFLT_IP);
|
||||
if (line != NULL && *line)
|
||||
if (*line)
|
||||
CONFIG_DFLT_IP = strdup(line);
|
||||
else
|
||||
CONFIG_DFLT_IP = NULL;
|
||||
|
|
@ -3967,7 +3967,7 @@ void load_config( void )
|
|||
else if (!str_cmp(tag, "logname")) {
|
||||
if (CONFIG_LOGNAME)
|
||||
free(CONFIG_LOGNAME);
|
||||
if (line != NULL && *line)
|
||||
if (*line)
|
||||
CONFIG_LOGNAME = strdup(line);
|
||||
else
|
||||
CONFIG_LOGNAME = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue