I think these were not strictly necessary, since passing a null
pointer to access(2) would have resulted in EINVAL rather than a
segfault. But it's clearer to put them in (and keeps static checkers a
bit happier).
}
old_dir3 = dupstr("/.putty");
- if (access(old_dir, F_OK) == 0) {
+ if (old_dir && access(old_dir, F_OK) == 0) {
ret = old_dir;
goto out;
}
- if (access(old_dir2, F_OK) == 0) {
+ if (old_dir2 && access(old_dir2, F_OK) == 0) {
ret = old_dir2;
goto out;
}