OSDN Git Service

Modify documents.
[ffftp/ffftp.git] / filelist.c
index 60f8ba2..74d14bb 100644 (file)
@@ -2654,6 +2654,9 @@ void MakeSelectedFileList(int Win, int Expand, int All, FILELIST **Base, int *Ca
                        if((Node == NODE_FILE) ||\r
                           ((Expand == NO) && (Node == NODE_DIR)))\r
                        {\r
+                               // 変数が未初期化のバグ修正\r
+                               memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                                Pkt.InfoExist = 0;\r
                                GetNodeName(Win, Pos, Pkt.File, FMAX_PATH);\r
                                if(GetNodeSize(Win, Pos, &Pkt.Size) == YES)\r
@@ -2690,6 +2693,9 @@ void MakeSelectedFileList(int Win, int Expand, int All, FILELIST **Base, int *Ca
                        {\r
                                if(GetNodeType(Win, Pos) == NODE_DIR)\r
                                {\r
+                                       // 変数が未初期化のバグ修正\r
+                                       memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                                        GetNodeName(Win, Pos, Name, FMAX_PATH);\r
                                        strcpy(Pkt.File, Name);\r
                                        ReplaceAll(Pkt.File, '\\', '/');\r
@@ -2787,6 +2793,9 @@ void MakeDroppedFileList(WPARAM wParam, char *Cur, FILELIST **Base)
 \r
                if((GetFileAttributes(Name) & FILE_ATTRIBUTE_DIRECTORY) == 0)\r
                {\r
+                       // 変数が未初期化のバグ修正\r
+                       memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                        Pkt.Node = NODE_FILE;\r
                        strcpy(Pkt.File, GetFileName(Name));\r
 \r
@@ -2817,6 +2826,9 @@ void MakeDroppedFileList(WPARAM wParam, char *Cur, FILELIST **Base)
 \r
                if(GetFileAttributes(Name) & FILE_ATTRIBUTE_DIRECTORY)\r
                {\r
+                       // 変数が未初期化のバグ修正\r
+                       memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                        Pkt.Node = NODE_DIR;\r
                        strcpy(Pkt.File, GetFileName(Name));\r
                        AddFileList(&Pkt, Base);\r
@@ -2936,6 +2948,9 @@ static void MakeRemoteTree2(char *Path, char *Cur, FILELIST **Base, int *CancelC
                        {\r
                                if(Pos->Node == NODE_DIR)\r
                                {\r
+                                       // 変数が未初期化のバグ修正\r
+                                       memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                                        /* まずディレクトリ名をセット */\r
                                        strcpy(Pkt.File, Pos->File);\r
                                        Pkt.Node = NODE_DIR;\r
@@ -3026,6 +3041,9 @@ void AddRemoteTreeToFileList(int Num, char *Path, int IncDir, FILELIST **Base)
                                {\r
                                        if(IncDir == RDIR_NLST)\r
                                        {\r
+                                               // 変数が未初期化のバグ修正\r
+                                               memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                                                strcpy(Pkt.File, Dir);\r
                                                Pkt.Node = NODE_DIR;\r
                                                Pkt.Size = 0;\r
@@ -3044,6 +3062,9 @@ void AddRemoteTreeToFileList(int Num, char *Path, int IncDir, FILELIST **Base)
                                        if((Node == NODE_FILE) ||\r
                                           ((IncDir == RDIR_CWD) && (Node == NODE_DIR)))\r
                                        {\r
+                                               // 変数が未初期化のバグ修正\r
+                                               memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                                                strcpy(Pkt.File, Dir);\r
                                                if(strlen(Pkt.File) > 0)\r
                                                        SetSlashTail(Pkt.File);\r
@@ -3211,6 +3232,9 @@ static void MakeLocalTree(char *Path, FILELIST **Base)
                        {\r
                                if(AskFilterStr(FindBuf.cFileName, NODE_FILE) == YES)\r
                                {\r
+                                       // 変数が未初期化のバグ修正\r
+                                       memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                                        strcpy(Pkt.File, Path);\r
                                        SetSlashTail(Pkt.File);\r
                                        strcat(Pkt.File, FindBuf.cFileName);\r
@@ -3239,6 +3263,9 @@ static void MakeLocalTree(char *Path, FILELIST **Base)
                           (strcmp(FindBuf.cFileName, ".") != 0) &&\r
                           (strcmp(FindBuf.cFileName, "..") != 0))\r
                        {\r
+                               // 変数が未初期化のバグ修正\r
+                               memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                                strcpy(Src, Path);\r
                                SetYenTail(Src);\r
                                strcat(Src, FindBuf.cFileName);\r