api.c all STATUS messages automatically escaped
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
diff --git a/api.c b/api.c
index 51f9d3b..67f0d78 100644
--- a/api.c
+++ b/api.c
@@ -496,7 +496,7 @@ struct CODES {
{ SEVERITY_INFO, MSG_PGALRDIS,PARAM_PGA, "PGA %d already disabled" },
{ SEVERITY_INFO, MSG_PGAENA, PARAM_PGA, "PGA %d sent enable message" },
{ SEVERITY_INFO, MSG_PGADIS, PARAM_PGA, "PGA %d set disable flag" },
- { SEVERITY_ERR, MSG_PGAUNW, PARAM_PGA, "PGA %d is not flagged WELL\\, cannot enable" },
+ { SEVERITY_ERR, MSG_PGAUNW, PARAM_PGA, "PGA %d is not flagged WELL, cannot enable" },
#endif
#ifdef WANT_CPUMINE
{ SEVERITY_ERR, MSG_CPUNON, PARAM_NONE, "No CPUs" },
@@ -564,8 +564,8 @@ struct CODES {
{ SEVERITY_SUCC, MSG_SETCONFIG,PARAM_SET, "Set config '%s' to %d" },
{ SEVERITY_ERR, MSG_UNKCON, PARAM_STR, "Unknown config '%s'" },
{ SEVERITY_ERR, MSG_INVNUM, PARAM_BOTH, "Invalid number (%d) for '%s' range is 0-9999" },
- { SEVERITY_ERR, MSG_CONPAR, PARAM_NONE, "Missing config parameters 'name\\,N'" },
- { SEVERITY_ERR, MSG_CONVAL, PARAM_STR, "Missing config value N for '%s\\,N'" },
+ { SEVERITY_ERR, MSG_CONPAR, PARAM_NONE, "Missing config parameters 'name,N'" },
+ { SEVERITY_ERR, MSG_CONVAL, PARAM_STR, "Missing config value N for '%s,N'" },
{ SEVERITY_FAIL, 0, 0, NULL }
};
@@ -1189,8 +1189,8 @@ static char *message(int messageid, int paramid, char *param2, bool isjson)
root = api_add_string(root, _STATUS, severity, false);
root = api_add_time(root, "When", &when, false);
root = api_add_int(root, "Code", &messageid, false);
- root = api_add_string(root, "Msg", buf, false);
- root = api_add_string(root, "Description", opt_api_description, false);
+ root = api_add_escape(root, "Msg", buf, false);
+ root = api_add_escape(root, "Description", opt_api_description, false);
root = print_data(root, ptr, isjson);
if (isjson)
@@ -1204,8 +1204,8 @@ static char *message(int messageid, int paramid, char *param2, bool isjson)
int id = -1;
root = api_add_int(root, "Code", &id, false);
sprintf(buf, "%d", messageid);
- root = api_add_string(root, "Msg", buf, false);
- root = api_add_string(root, "Description", opt_api_description, false);
+ root = api_add_escape(root, "Msg", buf, false);
+ root = api_add_escape(root, "Description", opt_api_description, false);
root = print_data(root, ptr, isjson);
if (isjson)