commit 6c7333821914f312bb960794905b6c2ed4dcfcec
parent 577ef5e9da6d538001262e95030d1552c4ee5107
Author: Friedolino <[email protected]>
Date: Fri, 2 Oct 2020 22:37:06 +0200
fix of fixed savexml port
Diffstat:
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/Misc/Part.cpp b/src/Misc/Part.cpp
@@ -176,9 +176,14 @@ static const Ports partPorts = {
time (&rawtime);
const struct tm* timeinfo = localtime (&rawtime);
strftime (filename,23,"%F_%R.xiz",timeinfo);
+ p->saveXML(filename);
+ fprintf(stderr, "Part %d saved to %s\n", (p->partno + 1), filename);
+ }
+ else
+ {
+ p->saveXML(p->loaded_file);
+ fprintf(stderr, "Part %d saved to %s\n", (p->partno + 1), p->loaded_file);
}
- p->saveXML(p->loaded_file);
- fprintf(stderr, "Part %d saved to %s\n", (p->partno + 1), p->loaded_file);
}},
//{"kit#16::T:F", "::Enables or disables kit item", 0,
// [](const char *m, RtData &d) {
@@ -1092,8 +1097,6 @@ int Part::saveXML(const char *filename)
xml.endbranch();
int result = xml.saveXMLfile(filename, gzip_compression);
- strncpy(loaded_file,filename, sizeof(loaded_file));
- loaded_file[sizeof(loaded_file)-1] = '\0';
return result;
}