Fix project saves where old data was left at the end if project has shrunk in size

This commit is contained in:
Henrik Nordstrom 2014-11-03 01:21:55 +01:00 committed by pancake
parent 5c5114c542
commit f024521b7d

View File

@ -77,7 +77,7 @@ R_API int r_core_project_save(RCore *core, const char *file) {
} }
r_core_project_init (core); r_core_project_init (core);
r_anal_project_save (core->anal, prj); r_anal_project_save (core->anal, prj);
fd = r_sandbox_open (prj, O_BINARY|O_RDWR|O_CREAT, 0644); fd = r_sandbox_open (prj, O_BINARY|O_RDWR|O_CREAT|O_TRUNC, 0644);
if (fd != -1) { if (fd != -1) {
fdold = r_cons_singleton ()->fdout; fdold = r_cons_singleton ()->fdout;
r_cons_singleton ()->fdout = fd; r_cons_singleton ()->fdout = fd;