Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb1442f4

Browse files
committed
[Issue#364] correctly set null-termination char during tablespace_map parsing
1 parent34741de commitb1442f4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/dir.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,9 +1160,10 @@ read_tablespace_map(parray *links, const char *backup_dir)
11601160

11611161
path=buf+n;
11621162

1163-
/* Remove newline character at the end of string */
1164-
i=strlen(path)-1;
1165-
path[i]='\0';
1163+
/* Remove newline character at the end of string if any */
1164+
i=strcspn(path,"\n");
1165+
if (strlen(path)>i)
1166+
path[i]='\0';
11661167

11671168
file=pgut_new(pgFile);
11681169
memset(file,0,sizeof(pgFile));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp