Date: Wed, 11 Aug 2004 19:32:54 +0000 From: "Thordur Ivar B." <thib@mi.is> To: freebsd-hackers@freebsd.org Subject: Where is strnlen() ? Message-ID: <20040811193254.6f0be2c2.thib@mi.is>
next in thread | raw e-mail | index | archive | help
While porting software from a friend wich was developed under Linux, I stumbled upon an error: src/socket.c:236: warning: implicit declaration of function `strnlen' Now my programming experience is nothing to brag about but I wonder why strnlen is not a part of FreeBSD's libc. I think that the use of strlen() insted of strnlen() could resault in buffer-overflow risks and my fellows (most of them are more experienced in the art of programming say that bounds checking is always good.) I have not found anything on google about this subject and if there is something that i overlooked then I'm real sorry for spamming this list. PS: I know that I could use glibc but GPL disgusts me ;) For more information about strnlen() see: http://www.linuxbase.org/spec/refspecs/LSB_1.2.0/gLSB/baselib-strnlen-3.html kv, thib[att]mi(dot).is -- As far as the laws of mathematics refer to reality, they are not certain, and as far as they are certain, they do not refer to reality. -- Albert Einstein
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040811193254.6f0be2c2.thib>