Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*-------------------------------------------------------------------------
*/

#include "c.h"
#include "pg_rman.h"

#include <libgen.h>
Expand Down Expand Up @@ -559,7 +560,7 @@ dir_read_file_list(const char *root, const char *file_txt)

while (fgets(buf, lengthof(buf), fp))
{
char path[MAXPGPATH];
char path[MAXPGPATH + 1];
char type;
unsigned long write_size;
pg_crc32c crc;
Expand All @@ -568,7 +569,7 @@ dir_read_file_list(const char *root, const char *file_txt)
pgFile *file;

memset(&tm, 0, sizeof(tm));
if (sscanf(buf, "%s %c %lu %u %o %d-%d-%d %d:%d:%d",
if (sscanf(buf, "%" CppAsString2(MAXPGPATH) "s %c %lu %u %o %d-%d-%d %d:%d:%d",
path, &type, &write_size, &crc, &mode,
&tm.tm_year, &tm.tm_mon, &tm.tm_mday,
&tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 11)
Expand Down