Use correct sizeof() argument in a couple of strncpy calls

Source and destination buffers are however the same length in both cases.

Per GitHub #561.
This commit is contained in:
Ian Barwick
2019-04-04 10:58:00 +09:00
parent 4e8b94c105
commit 538d5f9df0

View File

@@ -1065,7 +1065,7 @@ build_cluster_matrix(t_node_matrix_rec ***matrix_rec_dest, int *name_length, Ite
matrix_rec_list[i]->node_id = cell->node_info->node_id;
strncpy(matrix_rec_list[i]->node_name,
cell->node_info->node_name,
sizeof(cell->node_info->node_name));
sizeof(matrix_rec_list[i]->node_name));
/*
* Find the maximum length of a node name
@@ -1280,7 +1280,7 @@ build_cluster_crosscheck(t_node_status_cube ***dest_cube, int *name_length, Item
cube[h] = (t_node_status_cube *) pg_malloc(sizeof(t_node_status_cube));
cube[h]->node_id = cell->node_info->node_id;
strncpy(cube[h]->node_name, cell->node_info->node_name, sizeof(cell->node_info->node_name));
strncpy(cube[h]->node_name, cell->node_info->node_name, sizeof(cube[h]->node_name));
/*
* Find the maximum length of a node name