News for hackers. Stuff that matters.
Re:Getting Past C by thesmallestcat on Tuesday January 03, 2017 @07:17PM (#13314555)
I'm no C expert, but those do two different things (fixed vs. dynamic length, stack vs. heap alloc). And the first one is safe with strncpy, right? Though I don't know why you'd ever have code like this unless you like undefined behavior and want to return the array. The second example seems fine and not particularly difficult or verbose.

There are no comments on this comment yet.