From c2879bbf75263a2bb3ca630d28672fd773438054 Mon Sep 17 00:00:00 2001 From: iysheng Date: Wed, 9 Mar 2022 23:44:27 +0800 Subject: [PATCH] 1. Fix compile error with incompatible types 2. Fix function argument mismatch in README --- easyflash/plugins/types/README.md | 4 ++-- easyflash/plugins/types/ef_types.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/easyflash/plugins/types/README.md b/easyflash/plugins/types/README.md index 9f70741..d706b46 100644 --- a/easyflash/plugins/types/README.md +++ b/easyflash/plugins/types/README.md @@ -142,11 +142,11 @@ ef_set_struct(" /* 获取结构体类型环境变量 */ Student *student; -ef_get_struct("张三学生", student, stu_get_cb); +student = ef_get_struct("张三学生", stu_get_cb); /* 打印获取到的结构体内容 */ printf("姓名:%s 籍贯:%s \n", student->name, student->hometown.name); /* 释放获取结构体类型环境变量过程中开辟的动态内存 */ s2jHook.free_fn(student); -``` \ No newline at end of file +``` diff --git a/easyflash/plugins/types/ef_types.c b/easyflash/plugins/types/ef_types.c index 8c516b9..395f4fd 100644 --- a/easyflash/plugins/types/ef_types.c +++ b/easyflash/plugins/types/ef_types.c @@ -82,7 +82,7 @@ long ef_get_long(const char *key) { return atol(value); } else { EF_INFO("Couldn't find this ENV(%s)!\n", key); - return NULL; + return 0; } } @@ -96,7 +96,7 @@ double ef_get_double(const char *key) { return atof(value); } else { EF_INFO("Couldn't find this ENV(%s)!\n", key); - return NULL; + return 0; } }