summaryrefslogtreecommitdiffstats
path: root/src/rest.c
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-09-15 13:50:43 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-09-15 15:00:17 +0200
commitff71a2ad6e87a7ce5912cfc95fbcc772b22736f3 (patch)
tree934c5bc10a107e4bb03ee3be37232d21b3d3cd72 /src/rest.c
parentb59ff7c604fed8dc540668677a17bf03d7fbe6c1 (diff)
Fix size of og_cmd_get_client_setup() return array
The return array needs to store 1 extra element for the disk setup.
Diffstat (limited to 'src/rest.c')
-rw-r--r--src/rest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rest.c b/src/rest.c
index 997ee28..d02c984 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -1091,7 +1091,8 @@ static int og_cmd_get_client_setup(json_t *element,
}
len_part = 0;
- while (dbi_result_next_row(result) && len_part < OG_PARTITION_MAX) {
+ /* partition 0 represents the full disk, hence OG_PARTITION_MAX + 1. */
+ while (dbi_result_next_row(result) && len_part < OG_PARTITION_MAX + 1) {
partition.disk = dbi_result_get_int(result, "numdisk");
partition.number = dbi_result_get_int(result, "numpar");
partition.code = dbi_result_get_int(result, "codpar");