summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2024-09-03 14:13:30 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-09-03 14:24:09 +0200
commit7977711ee96b308d289fca1b20665e8a8e836786 (patch)
tree5f1e6ef9d466df2a27d21c92ea4f5c1edb7f8476 /src
parent38076677c7113bae4b50f7989ec45ebf521eae23 (diff)
rest: use integer for server idv1.2.5-18
id is not a string, use integer instead
Diffstat (limited to 'src')
-rw-r--r--src/rest.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rest.c b/src/rest.c
index 647458e..f836ef6 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -7979,11 +7979,12 @@ static int og_cmd_delete_server(json_t *element,
struct og_dbi *dbi;
dbi_result result;
json_t *value;
+ uint32_t id;
int err = 0;
json_object_foreach(element, key, value) {
if (!strcmp(key, "id")) {
- err = og_json_parse_string(value, &params->id);
+ err = og_json_parse_uint(value, &id);
params->flags |= OG_REST_PARAM_ID;
}
@@ -8002,8 +8003,8 @@ static int og_cmd_delete_server(json_t *element,
}
result = dbi_conn_queryf(dbi->conn,
- "DELETE FROM entornos WHERE identorno='%s'",
- params->id);
+ "DELETE FROM entornos WHERE identorno='%u'",
+ id);
if (!result) {
dbi_conn_error(dbi->conn, &msglog);