News for hackers. Stuff that matters.
Re:Memory management in C programs by anon4 on Monday March 17, 2014 @05:44AM (#7414034)
1) that will call strlen on "submenu"

2) the writer may be using a different malloc than the libc one

3) there is an argument to be made that using malloc plainly like this instead of hiding it with strdup makes it easy to see the sites in your program where heap memory is allocated

Re:Memory management in C programs by 0x09 on Monday March 17, 2014 @10:41AM (#7415241)
4) `strdup` is a POSIX extension whereas NetHack is cross platform.
Re:Memory management in C programs by angersock on Monday March 17, 2014 @01:27PM (#7416531)
Easy to fix with a macro.