[Ttssh2-commit] [8339] fclose()忘れ

scmno****@osdn***** scmno****@osdn*****
2019年 10月 28日 (月) 22:42:17 JST


Revision: 8339
          https://osdn.net/projects/ttssh2/scm/svn/commits/8339
Author:   zmatsuo
Date:     2019-10-28 22:42:17 +0900 (Mon, 28 Oct 2019)
Log Message:
-----------
fclose()忘れ

- 不要な const 削除

Modified Paths:
--------------
    branches/unicode_buf/teraterm/ttpmacro/fileread.cpp

-------------- next part --------------
Modified: branches/unicode_buf/teraterm/ttpmacro/fileread.cpp
===================================================================
--- branches/unicode_buf/teraterm/ttpmacro/fileread.cpp	2019-10-28 13:41:48 UTC (rev 8338)
+++ branches/unicode_buf/teraterm/ttpmacro/fileread.cpp	2019-10-28 13:42:17 UTC (rev 8339)
@@ -33,6 +33,9 @@
 #endif
 #include <windows.h>
 #include <tchar.h>
+#define _CRTDBG_MAP_ALLOC
+#include <crtdbg.h>
+
 #include "codeconv.h"
 #include "fileread.h"
 
@@ -175,10 +178,11 @@
 		return NULL;
 	}
 	char *u8 = LoadFileU8(fp, NULL);
+	fclose(fp);
 	if (u8 == NULL) {
 		return NULL;
 	}
-	const wchar_t *u16 = ToWcharU8(u8);
+	wchar_t *u16 = ToWcharU8(u8);
 	free(u8);
 	if (u16 == NULL) {
 		return NULL;
@@ -186,7 +190,7 @@
 	if (_len != NULL) {
 		*_len = wcslen(u16);
 	}
-	return (wchar_t *)u16;
+	return u16;
 }
 
 /**


Ttssh2-commit メーリングリストの案内