diff options
-rw-r--r-- | mbbsd/brc.c | 3 | ||||
-rw-r--r-- | mbbsd/fav.c | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/mbbsd/brc.c b/mbbsd/brc.c index d32e989b..f30bef17 100644 --- a/mbbsd/brc.c +++ b/mbbsd/brc.c @@ -321,8 +321,7 @@ brc_finalize(){ int ok=0; brc_update(); setuserfile(brcfile, fn_brc); - setuserfile(tmpfile, fn_brc); - strlcat(tmpfile, ".tmp", sizeof(tmpfile)); + snprintf(tmpfile, sizeof(tmpfile), "%s.tmp.%x", brcfile, getpid()); if (brc_buf != NULL && (fd = open(tmpfile, O_WRONLY | O_CREAT | O_TRUNC, 0644)) != -1) { if(write(fd, brc_buf, brc_size)==brc_size) diff --git a/mbbsd/fav.c b/mbbsd/fav.c index a1f2336a..bf1c7b7e 100644 --- a/mbbsd/fav.c +++ b/mbbsd/fav.c @@ -582,8 +582,8 @@ int fav_save(void) if (!dirty) return 0; - setuserfile(buf, FAV4".tmp"); setuserfile(buf2, FAV4); + snprintf(buf, sizeof(buf), "%s.tmp.%x",buf2, getpid()); fwp = fopen(buf, "w"); if(fwp == NULL) return -1; |