- char library[length + 5];
- memcpy(library, fname, prefix);
- memcpy(library + prefix, addition, 4);
- memcpy(library + prefix + 4, fname + prefix, length - prefix);
- library[length + 4] = '\0';
+ char library[length + 1];
+ memcpy(library, fname, length);
+ memcpy(library + length - 6 - 3, target, 3);
+ library[length] = '\0';