News for hackers. Stuff that matters.
Re:Interviewing programmers: coding test example explained by cperciva on Thursday June 03, 2010 @10:26AM (#1401388)
Using realloc would be better, since it allows the memory allocator the option of not copying the string.
Re:Interviewing programmers: coding test example explained by js2 on Thursday June 03, 2010 @10:59AM (#1401479)
Indeed. I wasn't sure you could realloc to a smaller block. Good to know.