mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-03-28 22:48:39 +02:00
Fix some warnings
This commit is contained in:
parent
ac4896e02c
commit
7ff4b9dfe3
2
dir.c
2
dir.c
@ -635,7 +635,7 @@ read_tablespace_map(parray *files, const char *backup_dir)
|
||||
path[MAXPGPATH];
|
||||
pgFile *file;
|
||||
|
||||
if (sscanf(buf, "%s %s", link_name, path) != 2)
|
||||
if (sscanf(buf, "%1023s %1023s", link_name, path) != 2)
|
||||
elog(ERROR, "invalid format found in \"%s\"", map_path);
|
||||
|
||||
file = pgut_new(pgFile);
|
||||
|
17
restore.c
17
restore.c
@ -450,7 +450,7 @@ restore_directories(const char *pg_data_dir, const char *backup_dir)
|
||||
|
||||
/* Extract link name from relative path */
|
||||
link_sep = first_dir_separator(link_ptr);
|
||||
if (link_sep)
|
||||
if (link_sep != NULL)
|
||||
{
|
||||
int len = link_sep - link_ptr;
|
||||
strncpy(link_name, link_ptr, len);
|
||||
@ -484,8 +484,12 @@ restore_directories(const char *pg_data_dir, const char *backup_dir)
|
||||
*/
|
||||
if (strcmp(dir_created, linked_path) == 0)
|
||||
{
|
||||
/* Create rest of directories */
|
||||
if (link_sep && (link_sep + 1))
|
||||
/*
|
||||
* Create rest of directories.
|
||||
* First check is there any directory name after
|
||||
* separator.
|
||||
*/
|
||||
if (link_sep != NULL && *(link_sep + 1) != '\0')
|
||||
goto create_directory;
|
||||
else
|
||||
continue;
|
||||
@ -528,8 +532,11 @@ restore_directories(const char *pg_data_dir, const char *backup_dir)
|
||||
/* Save linked directory */
|
||||
set_tablespace_created(link_name, linked_path);
|
||||
|
||||
/* Create rest of directories */
|
||||
if (link_sep && (link_sep + 1))
|
||||
/*
|
||||
* Create rest of directories.
|
||||
* First check is there any directory name after separator.
|
||||
*/
|
||||
if (link_sep != NULL && *(link_sep + 1) != '\0')
|
||||
goto create_directory;
|
||||
|
||||
continue;
|
||||
|
@ -235,7 +235,7 @@ void
|
||||
pg_log(eLogType type, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
int elevel;
|
||||
int elevel = INFO;
|
||||
|
||||
/* Transform logging level from eLogType to utils/logger.h levels */
|
||||
switch (type)
|
||||
|
Loading…
x
Reference in New Issue
Block a user