From 32c03b39d9844ebeb852de2f47a9769530efe70b Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Sat, 5 Apr 2014 04:45:30 +0000 Subject: [PATCH] Replace gets(3) with fgets(3) in my-basic gets(3) is going away; it's been removed by C11, and gcc now warns on it, breaking the build. --- src/mod/languages/mod_basic/my_basic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/languages/mod_basic/my_basic.c b/src/mod/languages/mod_basic/my_basic.c index 5976c19b58..5e805e538a 100644 --- a/src/mod/languages/mod_basic/my_basic.c +++ b/src/mod/languages/mod_basic/my_basic.c @@ -5640,7 +5640,7 @@ int _std_input(mb_interpreter_t* s, void** l) { obj = (_object_t*)(ast->data); if(obj->data.variable->data->type == _DT_INT || obj->data.variable->data->type == _DT_REAL) { - if(!gets(line)) { + if(!fgets(line, sizeof(line), stdin)) { result = MB_FUNC_ERR; goto _exit; } @@ -5660,7 +5660,7 @@ int _std_input(mb_interpreter_t* s, void** l) { } obj->data.variable->data->data.string = (char*)mb_malloc(256); memset(obj->data.variable->data->data.string, 0, 256); - if(gets(line)) { + if(fgets(line, sizeof(line), stdin)) { strcpy(obj->data.variable->data->data.string, line); } else { result = MB_FUNC_ERR;