LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] C being poliltically correct.

[ILUG] C being poliltically correct.

David Dorgan davidd at sponge.xevion.net
Sun Mar 14 02:39:16 GMT 2004


> Is there a list of ways to make sure that you are doing the correct thing when it comes 
> to writing C/C++ i.e as the above points out, or is it just trial and error.You can figure 
> out the simple thing about C/C++ but when it come to more complex stuff and learning bad habbits 
> can be a pain and costly,anyone any idea on what book/website i might look at.

Take a look at strlcpy, or strncpy, personally I'd use
strlcpy first.

If you ever produce code that goes into production, and uses
strcpy() then you should be taken out, beat with a stick
and shot.

For more information on teh strlcpy vs strncpy look at 
www.openbsd.org/papers/strlcpy-paper.ps
-- 
Eben Moglen talking to Richard Stallman about free software: "I said
to him, `Richard, you know, you and I are the two guys who didn't
make any money out of this revolution.' And then I paid for the lunch,
because I knew he didn't have the money to pay for it .'"




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell