Convert mju_error and mju_warning to variadic functions, supporting printf-like arguments. The functions mju_error_i, mju_error_s, mju_warning_i, and mju_warning_s are now deprecated.
PiperOrigin-RevId: 515431052 Change-Id: I440de0cb417ce216b6d636a5d86dc9ef6cc1fc06
This commit is contained in:
committed by
Copybara-Service
parent
2e6a37e8c5
commit
d3d789cf7d
@@ -223,8 +223,8 @@ int mjp_registerPlugin(const mjpPlugin* plugin) {
|
||||
} else if (plugin->nattribute < 0) {
|
||||
mju_error("plugin->nattribute is negative");
|
||||
} else if (plugin->nattribute > kMaxAttributes) {
|
||||
mju_error_i("plugin->nattribute exceeds the maximum limit of ",
|
||||
kMaxAttributes);
|
||||
mju_error("plugin->nattribute exceeds the maximum limit of %i",
|
||||
kMaxAttributes);
|
||||
}
|
||||
|
||||
char err[512];
|
||||
@@ -339,7 +339,7 @@ int mjp_registerPlugin(const mjpPlugin* plugin) {
|
||||
// plugin registration failed, throw an mju_error
|
||||
if (slot < 0) {
|
||||
err[sizeof(err) - 1] = '\0';
|
||||
mju_error(err);
|
||||
mju_error("%s", err);
|
||||
}
|
||||
|
||||
return slot;
|
||||
|
||||
Reference in New Issue
Block a user