mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 22:33:02 +01:00
Fix a couple minor issues
Print a warning if remove() fails, and check if the win pointer is null before using it (this is unnecessary but it's correct and shuts coverity up)
This commit is contained in:
parent
0d8e6d713e
commit
61740bda85
@ -242,7 +242,10 @@ static void print_wrap(WINDOW *win, struct line_info *line, int max_x)
|
|||||||
print_n_chars(win, msg, space_idx);
|
print_n_chars(win, msg, space_idx);
|
||||||
msg += space_idx + 1;
|
msg += space_idx + 1;
|
||||||
length -= (space_idx + 1);
|
length -= (space_idx + 1);
|
||||||
|
|
||||||
|
if (win) {
|
||||||
waddch(win, '\n');
|
waddch(win, '\n');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print_n_chars(win, msg, x_limit);
|
print_n_chars(win, msg, x_limit);
|
||||||
msg += x_limit;
|
msg += x_limit;
|
||||||
|
@ -358,7 +358,9 @@ int rename_logfile(const char *src, const char *dest, const char *selfkey, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists(newpath)) {
|
if (file_exists(newpath)) {
|
||||||
remove(oldpath);
|
if (remove(oldpath) != 0) {
|
||||||
|
fprintf(stderr, "Warning: remove() failed to remove log path `%s`\n", oldpath);
|
||||||
|
}
|
||||||
} else if (rename(oldpath, newpath) != 0) {
|
} else if (rename(oldpath, newpath) != 0) {
|
||||||
goto on_error;
|
goto on_error;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user