[fix] potential missing 0 termination (strncpy with wrong size)
[cleanup] combination of handmade 0 termination and strncat -> replaced by cleaner and faster strncpy
[fix] ugly "use after free" bug. The next item should be read before the current one is released.
[fix] conditional double free attempt.
      By the way, you could use scan-build to find this and similar bugs.
[fix] conditional uninitialized variable.
[fix] memory initializaton bug: wrong array size.
[fix] condition fix: code was never executed because of the wrong condition.
      (Code coverage test is advised, like gcov, kcov, etc.)
[fix] separator test: single separator != more than one separator.
[performance] assigning NULL to a pointer does not require a 'memset' call.
[fix] uninitialized variables -> initialized with 0.
[fix] conditional uninitialized variable
     (However, it has a quite low probability. Anyway, the code should be deterministic.)
[performance] strlen + strcpy is not efficient. strcpy can be replaced with memcpy which is more effective if the length is already known.
[fix] string formating: escape character fix.
[fix] string formating: another escape character fix.
[fix] conditional uninitialized pointer gets initial NULL value.
[fix] conditional segmentation fault: strcmp gets NULL pointer in the default branch which is invalid.
[fix] sizeof(pointer) == 4 or 8 (bytes), so in this case only the first 3 or 7 character is compared instead of the full string.
      The bug is actually architecture dependent (because of the pointer size) which makes it even worse.
[fix] potential uninitialized variable
[fix] format string does not match with variable type
[fix] assert(expression) is only evaluated if NDEBUG is defined. If NDEBUG is not defined, then return value is missing.
[fix] pointer should be checked, otherwise NULL pointer dereference could happen
[performance] sprintf is unnecessary for constant expressions -> replaced with the much faster strcpy
    This kind of transformation is quite easy with Coccinelle semantic patcher ( http://coccinelle.lip6.fr/ ):
    @@ expression E1,E2; @@
    (
    -  sprintf(E1,E2);
    +  strcpy(E1,E2);
    )