发现编译器报告gets函数unsafe,网上搜索了一下,发现gets函数不对接受字符串的buffer进行边界检测,会造成...
intmyown_gets(char*str) {inti=0;charc;while(scanf("%c",&c)&&(c=='\0'||c=='\n'));//这儿是用来吸收在myown_gets之前的残留在输入流中的回车用的str[i++]=c;while(scanf("%c",&c)&&(c!='\0'&&c!='\n')) { str[i++]=c; c=0; } str[i]=0;returni; } 这样自己的库...
make[1]: ***[all]错误 2make[1]:正在离开目录`/home/lmos/libiconv-1.14/srclib' make: ***[all]错误2 1. 2. 3. 4. 5. 解决: cdsrclib 目录sed-i-e'/gets is a security/d'./stdio.in.h 1. 2.
方法一:删除文件:stdio.in.h文件 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"),如下命令: cd libiconv-1.14/srclib sed -i -e '/gets is a security/d' ./stdio.in.h 方法二:将:/stdio.in.h文件中的: _GL_WARN_ON_USE (gets, "gets is a security hole - u...
PAGE PAGE 1 linux下使用gcc/g++编译代码时gets函数有错误 myfirst.cpp: In function int main() : myfirst.cpp:11:2: warning: char* gets(char*) is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] gets(cc); ^ myfirst.cpp:11:9: warning: char* gets(char*) ...
make[2]:正在离开目录 `/home/lmos/libiconv-1.14/srclib' make[1]: *** [all] 错误 2make[1]:正在离开目录 `/home/lmos/libiconv-1.14/srclib' make: *** [all] 错误 2 解决: 1 2 cdsrclib 目录 sed-i -e'/gets is a security/d'./stdio.in.h...
解决Centos7编译编译libiconv解决./stdio.h:1010:1: 错误: ‘gets’未声明(不在函数内 方法一:删除文件:stdio.in.h文件 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"),如下命令: cd libiconv-1.14/srclib sed -i -e '/gets is a security/d' ./stdio.in.h...