diff --git a/tagtinker_app.c b/tagtinker_app.c index fa1822f..1bff3d1 100644 --- a/tagtinker_app.c +++ b/tagtinker_app.c @@ -535,9 +535,11 @@ void tagtinker_targets_load(TagTinkerApp* app) { p = sep + 1; } - if(tagtinker_barcode_to_plid(fields[0], app->targets[app->target_count].plid)) { - TagTinkerTarget* target = &app->targets[app->target_count]; - memset(target, 0, sizeof(*target)); + /* Clear the slot first: clearing it after computing the PLID + * left every saved tag with PLID 00 00 00 00 (broadcast). */ + TagTinkerTarget* target = &app->targets[app->target_count]; + memset(target, 0, sizeof(*target)); + if(tagtinker_barcode_to_plid(fields[0], target->plid)) { strncpy(target->barcode, fields[0], TAGTINKER_BC_LEN); target->barcode[TAGTINKER_BC_LEN] = '\0';