Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • structure *tmp = malloc ((parent->count + count) * sizeof (structure *)); should probably be structure *tmp = malloc ((parent->count + count) * sizeof (structure));, since you're allocating space for structures rather than pointers to them. Commented Jul 15, 2015 at 3:33
  • Very minor nit: string literals separated only by whitespace are concatenated even without line-splicing - you don't need the backslashes. Commented Jul 15, 2015 at 3:35
  • @Dmitri I can't believe I missed that - that was it! Please put that in an answer so I can mark it correct. Commented Jul 15, 2015 at 3:35
  • @mlp noted. I will remember and use that in the future - thanks for the heads up! Commented Jul 15, 2015 at 3:36
  • Bigger nit: arguments passed to printf() must match the format string or you reap Undefined Behaviour. It seems unlikely that uint16_t (s->len and s->count) is the same as int (%i) on a platform that also supports int64_t. And you should use an unsigned format for an unsigned argument, too. Commented Jul 15, 2015 at 3:39