Properly check the return value of chdir, even if it is a "this
should not happen" case. Found with: Coverity Prevent(tm) CID: 4932
This commit is contained in:
parent
5a73d193c4
commit
78c6c39d48
@ -226,7 +226,8 @@ opencal(void)
|
||||
char *home = getenv("HOME");
|
||||
if (home == NULL || *home == '\0')
|
||||
errx(1, "cannot get home directory");
|
||||
chdir(home);
|
||||
if (chdir(home) != 0)
|
||||
errx(1, "cannot enter home directory");
|
||||
for (found = i = 0; i < sizeof(calendarHomes) /
|
||||
sizeof(calendarHomes[0]); i++)
|
||||
if (chdir(calendarHomes[i]) == 0 &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user