Skip to content

Commit 37ced69

Browse files
committed
Fix gcc warning messages
1 parent d8005d5 commit 37ced69

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/backup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,8 @@ do_backup_instance(void)
547547

548548
/* notify start of backup to PostgreSQL server */
549549
time2iso(label, lengthof(label), current.start_time);
550-
strncat(label, " with pg_probackup", lengthof(label));
550+
strncat(label, " with pg_probackup", lengthof(label) -
551+
strlen(" with pg_probackup"));
551552
pg_start_backup(label, smooth_checkpoint, &current);
552553

553554
pgBackupGetPath(&current, database_path, lengthof(database_path),

src/parsexlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ validate_wal(pgBackup *backup,
333333
*/
334334
if (backup->stream)
335335
{
336-
sprintf(backup_xlog_path, "/%s/%s/%s/%s",
336+
snprintf(backup_xlog_path, sizeof(backup_xlog_path), "/%s/%s/%s/%s",
337337
backup_instance_path, backup_id, DATABASE_DIR, PG_XLOG_DIR);
338338

339339
validate_backup_wal_from_start_to_stop(backup, backup_xlog_path, tli);

0 commit comments

Comments
 (0)