Fix return value of mj_saveXML and mj_saveXMLString, fixes #2247

PiperOrigin-RevId: 700269761
Change-Id: Ifb7e9c66c70eac7d681cfcf106712d47291cf9e2
This commit is contained in:
Alessio Quaglino
2024-11-26 02:31:53 -08:00
committed by Copybara-Service
parent 6e129a5ab2
commit e310c23267
7 changed files with 19 additions and 12 deletions
+2 -1
View File
@@ -117,7 +117,8 @@ MJAPI int mj_saveLastXML(const char* filename, const mjModel* m, char* error, in
// Free last XML model if loaded. Called internally at each load.
MJAPI void mj_freeLastXML(void);
// Save spec to XML string, return 1 on success, 0 otherwise.
// Save spec to XML string, return 0 on success, -1 on failure.
// If length of the output buffer is too small, returns the required size.
MJAPI int mj_saveXMLString(const mjSpec* s, char* xml, int xml_sz, char* error, int error_sz);
// Save spec to XML file, return 1 on success, 0 otherwise.