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

Commit 960ee46

Browse files
committed
fix warning ssu_rsync
1 parent d73fc53 commit 960ee46

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎ssu_rsync.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ int main(int argc, char *argv[])
3333
struct timeval begin_t, end_t;
3434

3535
// swap 생성
36-
char swap_path[MAX_BUFFER_SIZE];
36+
char swap_path[BUFFER_SIZE];
3737
char command[MAX_BUFFER_SIZE];
3838

3939
// 유효 검사
@@ -364,7 +364,7 @@ bool compare_file(file_node *src_file, file_node *dst_file) // 파일 정보 비
364364
while (now != NULL) {
365365

366366
#ifdef DEBUG
367-
printf("compare_file(): src_file->name = %s, dst_file->name = %s\n", src_file->name + strlen(pwd) + 1, now->name + strlen(pwd) + 1);
367+
printf("compare_file(): src_file->name = %s, dst_file->name = %s\n", src_file->name + strlen(pwd) + 1, now->name + strlen(dst_path) + 1);
368368
#endif
369369
if (!strcmp(src_file->name + strlen(pwd) + 1, now->name + strlen(dst_path) + 1)) { // 파일 이름이 같은 경우
370370

@@ -430,7 +430,7 @@ int write_change_list(file_node *head, int idx, int status, bool is_first) //
430430
change_list[idx].status = CREATE;
431431
} else if (status == DELETE) { // 삭제됨
432432
char tmp[MAX_BUFFER_SIZE];
433-
sprintf(tmp, "%s/%s", dst_path, get_file_name(src_path));
433+
sprintf(tmp, "%.*s/%s", (int)strlen(dst_path), dst_path, get_file_name(src_path));
434434
if(strstr(now->name, tmp) == NULL || !strcmp(now->name, tmp))
435435
break;
436436
strcpy(change_list[idx].name, now->name);
@@ -494,7 +494,7 @@ void recovery(int signo) // SIGINT 시그널 처리
494494
if(is_complete) // 동기화가 완료되었을 경우
495495
return;
496496

497-
sprintf(command, "tar -xvf %s", swap_path); // 복원 명령어 생성(압축 해제)
497+
sprintf(command, "tar -xvf %.*s", (int)strlen(swap_path), swap_path); // 복원 명령어 생성(압축 해제)
498498
#ifdef DEBUG
499499
printf("recovery(): command = %s\n", command);
500500
#endif

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /