Parcourir la source

fix: 修复listToArgumentFFI的内存溢出问题

SongZihuan il y a 4 ans
Parent
commit
3381c747a6
3 fichiers modifiés avec 2 ajouts et 3 suppressions
  1. 1 2
      main.c
  2. 1 1
      vmcore/file/file.c
  3. 0 0
      vmcore/src/parameter.c

+ 1 - 2
main.c

@@ -28,7 +28,6 @@ int main(int argc, char *argv[]) {
     if (args.run_commandLine)
         runCodeStdin(inter, HelloString);  // 从stdin中运行代码
     freeInter(inter, true);
-
-    system("pause");  // 按任意键继续...
+    fgetwc(stdin);  // 按任意键继续...
     return 0;
 }

+ 1 - 1
vmcore/file/file.c

@@ -50,7 +50,7 @@ char *splitDir(char * dir){
 
 char *findPath(char **path, char *env, bool need_free) {  // env 必须以 SEP 结尾
 #ifdef __linux
-    if (**path == SEP_CH) {
+    if (**path != SEP_CH) {
 #else
     if (!(isupper(**path) && (*path)[1] == ':')) {
 #endif

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
vmcore/src/parameter.c


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff