1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-05-27 06:44:49 -05:00

Fix error checking in uxstore.c: add a missing check, and fix a

mis-cut-and-pasted one.

[originally from svn r9950]
This commit is contained in:
Simon Tatham 2013-07-21 07:40:30 +00:00
parent f1d6fa4712
commit 77791de4e1

View File

@ -651,7 +651,12 @@ void store_host_key(const char *hostname, int port,
fclose(wfp);
rename(tmpfilename, filename);
if (rename(tmpfilename, filename) < 0) {
char *msg = dupprintf("Unable to store host key: rename(\"%s\",\"%s\")"
" returned '%s'", tmpfilename, filename,
strerror(errno));
nonfatal(msg);
}
sfree(tmpfilename);
sfree(filename);
@ -711,7 +716,7 @@ void write_random_seed(void *data, int len)
sfree(dir);
fd = open(fname, O_CREAT | O_WRONLY, 0600);
if (errno != ENOENT) {
if (fd < 0) {
char *msg = dupprintf("Unable to write random seed: open(\"%s\") "
"returned '%s'", fname, strerror(errno));
nonfatal(msg);