swap src and dst
authorMatt Corallo <git@bluematt.me>
Thu, 18 Feb 2021 18:27:56 +0000 (13:27 -0500)
committerMatt Corallo <git@bluematt.me>
Thu, 18 Feb 2021 18:27:56 +0000 (13:27 -0500)
lightning-persister/src/util.rs

index 1cff6dca8efc85f509ed315d177761486106d6ff..4c9111ef63a2680b5286aaf5e76504ce919c0676 100644 (file)
@@ -105,7 +105,7 @@ pub(crate) fn write_to_file<D: DiskWriteable>(path: String, filename: String, da
 
                if Path::new(&filename_with_path.clone()).exists() {
                        unsafe {winapi::um::winbase::ReplaceFileW(
-                               path_to_windows_str(src).as_ptr(), path_to_windows_str(dst).as_ptr(), std::ptr::null(),
+                               path_to_windows_str(dst).as_ptr(), path_to_windows_str(src).as_ptr(), std::ptr::null(),
                                winapi::um::winbase::REPLACEFILE_IGNORE_MERGE_ERRORS, std::ptr::null_mut() as *mut winapi::ctypes::c_void, std::ptr::null_mut() as *mut winapi::ctypes::c_void
                        )};
                } else {