From 4d2e1dd31cb82f96822966d960b5bd9e1cea59d1 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Tue, 9 Feb 2021 12:07:59 +0000 Subject: #1004 Fix client setup disk size showing as 0 og_cmd_get_client_setup is querying the database for computers disk setup information. This includes the size of a disk or a partition, which are stored as BIGINT in the database. Using dbi_result_get_int will result in an error as libdbi expects to store this kind of data type in a long long instead of an int. Fix disk size variable declaration and use the correct dbi_result_get function for this particular data column. --- src/rest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rest.c b/src/rest.c index 6592586..bc6c2b3 100644 --- a/src/rest.c +++ b/src/rest.c @@ -1134,7 +1134,7 @@ static int og_cmd_get_client_setup(json_t *element, int disk; int number; int code; - int size; + uint64_t size; int filesystem; int format; int os; @@ -1201,7 +1201,7 @@ static int og_cmd_get_client_setup(json_t *element, partition.disk = dbi_result_get_int(result, "numdisk"); partition.number = dbi_result_get_int(result, "numpar"); partition.code = dbi_result_get_int(result, "codpar"); - partition.size = dbi_result_get_int(result, "tamano"); + partition.size = dbi_result_get_longlong(result, "tamano"); partition.used_size = dbi_result_get_int(result, "uso"); partition.filesystem = dbi_result_get_int(result, "idsistemafichero"); partition.os = dbi_result_get_int(result, "idnombreso"); -- cgit v1.2.3-18-g5258