Index: trunk/src_plugins/io_kicad_legacy/uniq_name.c =================================================================== --- trunk/src_plugins/io_kicad_legacy/uniq_name.c (revision 2664) +++ trunk/src_plugins/io_kicad_legacy/uniq_name.c (revision 2665) @@ -33,7 +33,7 @@ char *name, *end; const char *head; - if (orig_name == NULL) { + if ((orig_name == NULL) || (*orig_name == '\0')) { head = state->unnamed; l1 = strlen(state->unnamed); l2 = strlen(state->suffix_sep); Index: trunk/src_plugins/io_kicad_legacy/uniq_name.h =================================================================== --- trunk/src_plugins/io_kicad_legacy/uniq_name.h (revision 2664) +++ trunk/src_plugins/io_kicad_legacy/uniq_name.h (revision 2665) @@ -20,6 +20,7 @@ - if orig_name is NULL, generate an unnamed item - if orig_name is not-NULL and is unseen so far, return a copy of orig_name - if orig_name is not-NULL and has been already seen, return a modified version + - an empty, non-NULL orig_name handled as if it was NULL Strings returned are newly allocated and can be used until unm_uninit() is called on state. */ const char *unm_name(unm_t *state, const char *orig_name);