mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Avoid compiler warnings for various strncpy() operations
Here the compiler may complain that the source length is being used, though in all cases the source length was previously used to define the length of the destination buffer, so it's not actually a problem.
This commit is contained in:
@@ -2250,6 +2250,7 @@ print_event_notification_list(EventNotificationList *list)
|
||||
PQExpBufferData buf;
|
||||
char *ptr;
|
||||
EventNotificationListCell *cell;
|
||||
int ptr_len;
|
||||
|
||||
initPQExpBuffer(&buf);
|
||||
cell = list->head;
|
||||
@@ -2264,8 +2265,10 @@ print_event_notification_list(EventNotificationList *list)
|
||||
cell = cell->next;
|
||||
}
|
||||
|
||||
ptr = palloc0(strlen(buf.data) + 1);
|
||||
strncpy(ptr, buf.data, strlen(buf.data));
|
||||
ptr_len = strlen(buf.data);
|
||||
ptr = palloc0(ptr_len + 1);
|
||||
|
||||
strncpy(ptr, buf.data, ptr_len);
|
||||
|
||||
termPQExpBuffer(&buf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user