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

Commite01d84e

Browse files
committed
Fix check digit chars.
1 parent9d27333 commite01d84e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎backup.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,14 +1108,21 @@ add_files(parray *files, const char *root, bool add_root, bool is_pgdata)
11081108
file->is_datafile= true;
11091109
{
11101110
intfind_dot;
1111+
intcheck_digit;
11111112
char*text_segno;
11121113
for(find_dot=path_len-1;file->path[find_dot]!='.'&&find_dot >=0;find_dot--);
11131114
if (find_dot <=0)
11141115
continue;
11151116

11161117
text_segno=file->path+find_dot+1;
1117-
/* in future we will need check all chars */
1118-
if (!isdigit(text_segno[0]))
1118+
for(check_digit=0;text_segno[check_digit]!='\0';check_digit++)
1119+
if (!isdigit(text_segno[check_digit]))
1120+
{
1121+
check_digit=-1;
1122+
break;
1123+
}
1124+
1125+
if (check_digit==-1)
11191126
continue;
11201127

11211128
file->segno= (int)strtol(text_segno,NULL,10);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp