tree-wide: drop unnecessary break in default branch

This commit is contained in:
Yu Watanabe
2025-03-06 11:42:20 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent c65f40b1a1
commit 5c9feb2d6e
64 changed files with 43 additions and 133 deletions
+1 -1
View File
@@ -212,7 +212,7 @@ static int smbios_fields_acquire(char16_t *fields[static _CHID_SMBIOS_FIELDS_MAX
}
default:
break;
;
}
fields[f] = utf8_to_utf16(buf, size);
-3
View File
@@ -49,7 +49,6 @@ static int table_add_designator_line(Table *table, PartitionDesignator d, Partit
default:
r = table_add_many(table, TABLE_EMPTY);
break;
}
if (r < 0)
return table_log_add_error(r);
@@ -66,9 +65,7 @@ static int table_add_designator_line(Table *table, PartitionDesignator d, Partit
default:
r = table_add_many(table, TABLE_EMPTY);
break;
}
if (r < 0)
return table_log_add_error(r);
-4
View File
@@ -335,10 +335,6 @@ static char *ascii_ellipsize_mem(const char *s, size_t old_length, size_t new_le
case 2:
if (!is_locale_utf8())
return strdup("..");
break;
default:
break;
}
-1
View File
@@ -346,7 +346,6 @@ static void print_status(Config *config, char16_t *loaded_image_path) {
break;
default:
printf(" console-mode (config): %" PRIi64 "\n", config->console_mode);
break;
}
/* EFI var console mode is always a concrete value or unset. */
-1
View File
@@ -1066,7 +1066,6 @@ static int loop(const char *root) {
fprintf(stdout, "\nUnknown key '%c'. Ignoring.", key);
fflush(stdout);
sleep(1);
break;
}
}
}
-1
View File
@@ -1006,7 +1006,6 @@ static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, vo
default:
log_unit_error(UNIT(a), "Received unknown automount request %i", packet.hdr.type);
break;
}
return 0;
+1 -1
View File
@@ -2178,7 +2178,7 @@ static int exec_context_serialize(const ExecContext *c, FILE *f) {
break;
default:
break;
;
}
r = serialize_std_out_err(c, f, STDOUT_FILENO);
-1
View File
@@ -1687,7 +1687,6 @@ static int become_shutdown(int objective, int retval) {
case LOG_TARGET_CONSOLE:
default:
command_line[pos++] = "--log-target=console";
break;
};
if (log_get_show_color())
+3 -4
View File
@@ -773,7 +773,7 @@ static void mount_catchup(Unit *u) {
mount_set_state(m, MOUNT_MOUNTING_DONE);
break;
default:
break;
;
}
else
switch (m->state) {
@@ -786,7 +786,7 @@ static void mount_catchup(Unit *u) {
mount_enter_dead(m, MOUNT_SUCCESS, /* flush_result = */ false);
break;
default:
break;
;
}
}
@@ -2242,7 +2242,7 @@ static int mount_process_proc_self_mountinfo(Manager *m) {
break;
default:
break;
;
}
} else if (mount->proc_flags & (MOUNT_PROC_JUST_MOUNTED|MOUNT_PROC_JUST_CHANGED)) {
@@ -2270,7 +2270,6 @@ static int mount_process_proc_self_mountinfo(Manager *m) {
* in case somebody is waiting for this. (e.g. file system ro/rw
* remounts.) */
mount_set_state(mount, mount->state);
break;
}
}
-2
View File
@@ -349,7 +349,6 @@ int mac_smack_setup(bool *loaded_policy) {
break;
default:
log_warning_errno(r, "Failed to load Smack/CIPSO access rules, ignoring: %m");
break;
}
r = write_netlabel_rules("/etc/smack/netlabel.d/");
@@ -365,7 +364,6 @@ int mac_smack_setup(bool *loaded_policy) {
break;
default:
log_warning_errno(r, "Failed to load Smack network host rules: %m, ignoring.");
break;
}
r = write_onlycap_list();
+2 -6
View File
@@ -1190,7 +1190,6 @@ static int swap_process_proc_swaps(Manager *m) {
default:
/* Fire again */
swap_set_state(swap, swap->state);
break;
}
if (swap->what)
@@ -1214,12 +1213,9 @@ static int swap_process_proc_swaps(Manager *m) {
break;
default:
/* Nothing really changed, but let's
* issue an notification call
* nonetheless, in case somebody is
* waiting for this. */
/* Nothing really changed, but let's issue an notification call nonetheless,
* in case somebody is waiting for this. */
swap_set_state(swap, swap->state);
break;
}
}
+1 -1
View File
@@ -1633,7 +1633,7 @@ static int forward_coredump_to_container(Context *context) {
break;
default:
break;
;
}
r = iovw_put_string_field(iovw, meta_field_names[i], t);
-1
View File
@@ -190,7 +190,6 @@ static int run(int argc, char *argv[]) {
v = detect_virtualization();
if (v < 0)
return log_error_errno(v, "Failed to check for virtualization: %m");
break;
}
if (!arg_quiet)
+1 -1
View File
@@ -2154,7 +2154,7 @@ static int run(int argc, char *argv[]) {
default:
/* All other actions need the image dissected (except for ACTION_VALIDATE, see below) */
break;
;
}
if (arg_image) {
+1 -1
View File
@@ -401,7 +401,7 @@
_found = true; \
break; \
default: \
break; \
; \
} \
_found; \
})
+1 -1
View File
@@ -1790,7 +1790,7 @@ static int home_passwd(UserRecord *h, UserRecord **ret_home) {
break;
default:
break;
;
}
r = home_store_header_identity_luks(new_home, &setup, header_home);
-4
View File
@@ -1016,8 +1016,6 @@ _public_ PAM_EXTERN int pam_sm_acct_mgmt(
(void) pam_prompt_graceful(handle, PAM_ERROR_MSG, NULL, _("User record not valid, prohibiting access."));
return PAM_ACCT_EXPIRED;
}
break;
}
t = user_record_ratelimit_next_try(ur);
@@ -1067,8 +1065,6 @@ _public_ PAM_EXTERN int pam_sm_acct_mgmt(
(void) pam_prompt_graceful(handle, PAM_ERROR_MSG, NULL, _("User record not valid, prohibiting access."));
return PAM_AUTHTOK_EXPIRED;
}
break;
}
return PAM_SUCCESS;
-2
View File
@@ -1223,7 +1223,6 @@ int user_record_good_authentication(UserRecord *h) {
break;
default:
counter = h->good_authentication_counter + 1;
break;
}
usec = now(CLOCK_REALTIME);
@@ -1279,7 +1278,6 @@ int user_record_bad_authentication(UserRecord *h) {
break;
default:
counter = h->bad_authentication_counter + 1;
break;
}
usec = now(CLOCK_REALTIME);
-1
View File
@@ -181,7 +181,6 @@ static int parse_pull_expression(const char *v) {
default:
assert_not_reached();
break;
}
if (r < 0)
return log_error_errno(r, "Failed to strip suffix from URL '%s': %m", remote);
+1 -1
View File
@@ -524,7 +524,7 @@ static int transfer_start(Transfer *t) {
break;
default:
break;
;
}
if (t->verify != _IMPORT_VERIFY_INVALID) {
-2
View File
@@ -345,8 +345,6 @@ static int parse_options(const uint8_t options[], size_t buflen, uint8_t *overlo
default:
if (cb)
cb(code, len, option, userdata);
break;
}
offset += len;
+1 -2
View File
@@ -203,7 +203,7 @@ int sd_dhcp_client_set_request_option(sd_dhcp_client *client, uint8_t option) {
return -EINVAL;
default:
break;
;
}
return set_ensure_put(&client->req_opts, NULL, UINT8_TO_PTR(option));
@@ -1188,7 +1188,6 @@ static int client_send_request(sd_dhcp_client *client) {
default:
log_dhcp_client(client, "REQUEST (invalid)");
break;
}
return 0;
-1
View File
@@ -1076,7 +1076,6 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const void *option, void
default:
log_debug("Ignoring DHCP option %"PRIu8" while parsing.", code);
break;
}
return 0;
+1 -1
View File
@@ -293,7 +293,7 @@ int dnr_parse_svc_params(const uint8_t *option, size_t len, sd_dns_resolver *res
break;
default:
break;
;
}
offset += plen;
}
+2 -3
View File
@@ -163,8 +163,7 @@ static void test_dhcp_identifier_set_iaid(void) {
static int check_options(uint8_t code, uint8_t len, const void *option, void *userdata) {
switch (code) {
case SD_DHCP_OPTION_CLIENT_IDENTIFIER:
{
case SD_DHCP_OPTION_CLIENT_IDENTIFIER: {
sd_dhcp_duid duid;
uint32_t iaid;
@@ -181,7 +180,7 @@ static int check_options(uint8_t code, uint8_t len, const void *option, void *us
}
default:
break;
;
}
return 0;
-1
View File
@@ -37,7 +37,6 @@ static void basic_request_handler(sd_ipv4ll *ll, int event, void *userdata) {
break;
default:
assert_se(0);
break;
}
}
-1
View File
@@ -1398,7 +1398,6 @@ int message_append_basic(sd_bus_message *m, char type, const void *p, const void
default:
align = bus_type_get_alignment(type);
sz = bus_type_get_size(type);
break;
}
assert(align > 0);
-3
View File
@@ -481,7 +481,6 @@ static int invoke_property_get(
default:
p = userdata;
break;
}
return sd_bus_message_append_basic(reply, v->x.property.signature[0], p);
@@ -554,8 +553,6 @@ static int invoke_property_set(
r = sd_bus_message_read_basic(value, v->x.property.signature[0], userdata);
if (r < 0)
return r;
break;
}
return 1;
+1 -5
View File
@@ -254,9 +254,7 @@ static int journal_file_set_online(JournalFile *f) {
return r;
wait = false;
break;
}
}
}}
}
if (mmap_cache_fd_got_sigbus(f->cache_fd))
@@ -3822,8 +3820,6 @@ void journal_file_dump(JournalFile *f) {
log_info("Type: %s \n", s);
else
log_info("Type: unknown (%i)", o->object.type);
break;
}
c = COMPRESSION_FROM_OBJECT(o);
+4 -5
View File
@@ -990,7 +990,7 @@ _public_ int64_t sd_json_variant_integer(sd_json_variant *v) {
}
default:
break;
;
}
mismatch:
@@ -1035,7 +1035,7 @@ _public_ uint64_t sd_json_variant_unsigned(sd_json_variant *v) {
}
default:
break;
;
}
mismatch:
@@ -1081,7 +1081,7 @@ _public_ double sd_json_variant_real(sd_json_variant *v) {
}
default:
break;
;
}
mismatch:
@@ -1117,7 +1117,7 @@ _public_ int sd_json_variant_is_negative(sd_json_variant *v) {
return false;
default:
break;
;
}
mismatch:
@@ -1649,7 +1649,6 @@ static void json_format_string(FILE *f, const char *q, sd_json_format_flags_t fl
fprintf(f, "\\u%04x", (unsigned) *q);
else
fputc(*q, f);
break;
}
if (flags & SD_JSON_FORMAT_COLOR)
-2
View File
@@ -338,7 +338,6 @@ static int button_dispatch(sd_event_source *s, int fd, uint32_t revents, void *u
default:
b->button_modifier_mask |= button_get_keycode_modifier_mask(ev.code);
break;
}
} else if (ev.type == EV_KEY && ev.value == 0) {
@@ -402,7 +401,6 @@ static int button_dispatch(sd_event_source *s, int fd, uint32_t revents, void *u
default:
b->button_modifier_mask &= ~button_get_keycode_modifier_mask(ev.code);
break;
}
} else if (ev.type == EV_SW && ev.value > 0) {
+3 -3
View File
@@ -171,7 +171,7 @@ static int session_device_open(SessionDevice *sd, bool active) {
case DEVICE_TYPE_UNKNOWN:
default:
/* fallback for devices without synchronizations */
break;
;
}
return TAKE_FD(fd);
@@ -215,7 +215,7 @@ static int session_device_start(SessionDevice *sd) {
case DEVICE_TYPE_UNKNOWN:
default:
/* fallback for devices without synchronizations */
break;
;
}
sd->active = true;
@@ -262,7 +262,7 @@ static void session_device_stop(SessionDevice *sd) {
case DEVICE_TYPE_UNKNOWN:
default:
/* fallback for devices without synchronization */
break;
;
}
sd->active = false;
+1 -1
View File
@@ -1074,7 +1074,7 @@ static void session_context_mangle(
break;
default:
break;
;
}
pam_debug_syslog(handle, debug, "Automatically chose session class '%s'.", c->class);
-2
View File
@@ -125,7 +125,6 @@ static int netdev_l2tp_create_message_tunnel(NetDev *netdev, union in_addr_union
case NETDEV_L2TP_ENCAPTYPE_UDP:
default:
encap_type = L2TP_ENCAPTYPE_UDP;
break;
}
r = sd_netlink_message_append_u16(m, L2TP_ATTR_ENCAP_TYPE, encap_type);
@@ -227,7 +226,6 @@ static int netdev_l2tp_create_message_session(NetDev *netdev, L2tpSession *sessi
default:
l2_spec_type = L2TP_L2SPECTYPE_DEFAULT;
l2_spec_len = 4;
break;
}
r = sd_netlink_message_append_u8(m, L2TP_ATTR_L2SPEC_TYPE, l2_spec_type);
-1
View File
@@ -574,7 +574,6 @@ static int netdev_ip6tnl_fill_message_create(NetDev *netdev, Link *link, sd_netl
case NETDEV_IP6_TNL_MODE_ANYIP6:
default:
proto = 0;
break;
}
r = sd_netlink_message_append_u8(m, IFLA_IPTUN_PROTO, proto);
+2 -4
View File
@@ -472,8 +472,7 @@ void address_hash_func(const Address *a, struct siphash *state) {
break;
default:
/* treat any other address family as AF_UNSPEC */
break;
assert_not_reached();
}
}
@@ -515,8 +514,7 @@ int address_compare_func(const Address *a1, const Address *a2) {
return r;
default:
/* treat any other address family as AF_UNSPEC */
return 0;
assert_not_reached();
}
}
-1
View File
@@ -293,7 +293,6 @@ static int bridge_mdb_verify(BridgeMDB *mdb) {
"%s: MulticastGroupAddress= is the multicast all nodes address. "
"Ignoring [BridgeMDB] section from line %u.",
mdb->section->filename, mdb->section->line);
break;
}
break;
default:
-1
View File
@@ -1284,7 +1284,6 @@ static int dhcp4_handler(sd_dhcp_client *client, int event, void *userdata) {
log_link_warning_errno(link, event, "DHCP error: Client failed: %m");
else
log_link_warning(link, "DHCP unknown event: %i", event);
break;
}
return 0;
-1
View File
@@ -156,7 +156,6 @@ static void ipv4ll_handler(sd_ipv4ll *ll, int event, void *userdata) {
break;
default:
log_link_warning(link, "IPv4 link-local unknown event: %d", event);
break;
}
}
+2 -4
View File
@@ -121,8 +121,7 @@ static void route_hash_func(const Route *route, struct siphash *state) {
break;
default:
/* treat any other address family as AF_UNSPEC */
break;
assert_not_reached();
}
}
@@ -209,8 +208,7 @@ static int route_compare_func(const Route *a, const Route *b) {
return route_nexthops_compare_func(a, b);
default:
/* treat any other address family as AF_UNSPEC */
return 0;
assert_not_reached();
}
}
+2 -2
View File
@@ -641,10 +641,10 @@ static int link_is_ready_to_set_link(Link *link, Request *req) {
return -EALREADY; /* Not necessary to set the same value. */
req->userdata = UINT32_TO_PTR(mtu);
return true;
break;
}
default:
break;
;
}
return true;
-3
View File
@@ -742,8 +742,6 @@ static int event_log_record_extract_firmware_description(EventLogRecord *rec) {
r = strextendf_with_separator(&rec->description, ", ", "Tag 0x%" PRIx32 ": %s", tag->taggedEventID, s);
if (r < 0)
return log_error_errno(r, "Failed to format EV_EVENT_TAG description string: %m");
break;
}}
tag = (TCG_PCClientTaggedEvent*) ((uint8_t*) tag + m);
@@ -1437,7 +1435,6 @@ static int event_log_record_validate_hash_firmware(
hdata = record->firmware_payload;
hsz = record->firmware_payload_size;
strict = false;
break;
}
int mdsz = EVP_MD_size(md);
-1
View File
@@ -1027,7 +1027,6 @@ static void resolve_service_all_complete(DnsQuery *query) {
default:
bad = aux;
break;
}
}
+2 -6
View File
@@ -287,7 +287,7 @@ int dns_packet_validate_reply(DnsPacket *p) {
break;
default:
break;
;
}
return 1;
@@ -356,7 +356,7 @@ int dns_packet_validate_query(DnsPacket *p) {
break;
default:
break;
;
}
return 1;
@@ -1267,9 +1267,7 @@ int dns_packet_append_rr(DnsPacket *p, const DnsResourceRecord *rr, const DnsAns
case DNS_TYPE_OPENPGPKEY:
case _DNS_TYPE_INVALID: /* unparsable */
default:
r = dns_packet_append_blob(p, rr->generic.data, rr->generic.data_size, NULL);
break;
}
if (r < 0)
goto fail;
@@ -2326,8 +2324,6 @@ int dns_packet_read_rr(
default:
unparsable:
r = dns_packet_read_memdup(p, rdlength, &rr->generic.data, &rr->generic.data_size, NULL);
break;
}
if (r < 0)
return r;
-4
View File
@@ -254,8 +254,6 @@ static DnsTransactionState dns_query_candidate_state(DnsQueryCandidate *c) {
default:
if (state != DNS_TRANSACTION_SUCCESS)
state = t->state;
break;
}
return state;
@@ -1047,7 +1045,6 @@ static void dns_query_accept(DnsQuery *q, DnsQueryCandidate *c) {
DNS_PACKET_REPLACE(q->answer_full_packet, dns_packet_ref(t->received));
state = t->state;
break;
}
}
@@ -1113,7 +1110,6 @@ void dns_query_ready(DnsQuery *q) {
default:
/* Any kind of failure */
bad = c;
break;
}
}
+1 -6
View File
@@ -930,12 +930,10 @@ static char *format_svc_param_value(DnsSvcParam *i) {
}
return strv_join(values_strv, ",");
}
default: {
default:
value = decescape((char*) &i->value, i->length, " ,");
if (!value)
return NULL;
break;
}
}
char *qvalue;
@@ -1346,7 +1344,6 @@ const char* dns_resource_record_to_string(DnsResourceRecord *rr) {
}
if (r < 0)
return NULL;
break;
}
rr->to_string = s;
@@ -1671,7 +1668,6 @@ void dns_resource_record_hash_func(const DnsResourceRecord *rr, struct siphash *
case DNS_TYPE_OPENPGPKEY:
default:
siphash24_compress_safe(rr->generic.data, rr->generic.data_size, state);
break;
}
}
@@ -1909,7 +1905,6 @@ DnsResourceRecord *dns_resource_record_copy(DnsResourceRecord *rr) {
if (!copy->generic.data)
return NULL;
copy->generic.data_size = rr->generic.data_size;
break;
}
t = TAKE_PTR(copy);
+1 -1
View File
@@ -1555,7 +1555,7 @@ DnsScope* manager_find_scope(Manager *m, DnsPacket *p) {
break;
default:
break;
;
}
return NULL;
-1
View File
@@ -724,7 +724,6 @@ static void resolve_service_all_complete(DnsQuery *query) {
default:
bad = aux;
break;
}
}
if (!have_success) {
-1
View File
@@ -368,7 +368,6 @@ static int run(int argc, char *argv[]) {
default:
log_debug("Unknown event %u from /dev/rfkill for index %u and type %s, ignoring.", event.op, event.idx, type);
break;
}
}
-1
View File
@@ -335,7 +335,6 @@ static int bus_append_exec_command(sd_bus_message *m, const char *field, const c
default:
done = true;
break;
}
} while (!done);
-1
View File
@@ -78,7 +78,6 @@ int sigrtmin18_handler(sd_event_source *s, const struct signalfd_siginfo *si, vo
default:
log_notice("Received control signal %s with unknown command 0x%08x, ignoring.",
signal_to_string(si->ssi_signo), (unsigned) si->ssi_int);
break;
}
return 0;
+1 -1
View File
@@ -1902,7 +1902,7 @@ int partition_pick_mount_options(
break;
default:
break;
;
}
/* So, when you request MS_RDONLY from ext4, then this means nothing. It happily still writes to the
-1
View File
@@ -137,7 +137,6 @@ int journal_access_check_and_warn(sd_journal *j, bool quiet, bool want_other_use
default:
log_warning_errno(err, "An error was encountered while opening journal file or directory %s, ignoring file: %m", path);
break;
}
}
+2 -2
View File
@@ -541,7 +541,7 @@ static int fido2_use_hmac_hash_specific_token(
break;
default:
break;
;
}
if (!retry_with_up && !retry_with_pin)
@@ -1027,7 +1027,7 @@ int fido2_generate_hmac_hash(
break;
default:
break;
;
}
if (!retry_with_up && !retry_with_pin)
-1
View File
@@ -1598,7 +1598,6 @@ int seccomp_restrict_address_families(Set *address_families, bool allow_list) {
/* These we either know we don't support (i.e. are the ones that do use socketcall()), or we
* don't know */
supported = false;
break;
}
if (!supported)
-1
View File
@@ -153,7 +153,6 @@ void user_record_show(UserRecord *hr, bool show_full_group_info) {
}
printf(" Login OK: %syes%s\n", ansi_highlight_green(), ansi_normal());
break;
}}
r = user_record_test_password_change_required(hr);
@@ -34,7 +34,6 @@ static int list_dependencies_print(const char *name, UnitActiveState state, int
default:
on = ansi_highlight_red();
break;
}
printf("%s%s%s ", on, special_glyph(unit_active_state_to_glyph(state)), ansi_normal());
-1
View File
@@ -850,7 +850,6 @@ int transfer_vacuum(
default:
assert_not_reached();
break;
}
instance_free(oldest);
+1 -1
View File
@@ -3919,7 +3919,7 @@ static int parse_line(
break;
default:
break;
;
}
if (from_cred) {
-1
View File
@@ -489,7 +489,6 @@ static int run(int argc, char *argv[]) {
break;
default:
printf("ID_TYPE=generic\n");
break;
}
} else
printf("ID_TYPE=disk\n");
-1
View File
@@ -482,7 +482,6 @@ static int cd_profiles(Context *c) {
break;
default:
log_debug("GET CONFIGURATION: feature 0x%04x <ignored>, with 0x%02x bytes", feature, features[i + 3]);
break;
}
}
-1
View File
@@ -71,7 +71,6 @@ int probe_smart_media(int mtd_fd, mtd_info_t* info) {
break;
default:
spare_count = 24;
break;
}
for (offset = 0; offset < block_size * spare_count; offset += sector_size) {
-2
View File
@@ -93,7 +93,6 @@ static void set_type(unsigned type_num, char *to, size_t len) {
break;
default:
type = "generic";
break;
}
strscpy(to, len, type);
}
@@ -368,7 +367,6 @@ static int per_dev_options(struct scsi_id_device *dev_scsi, int *good_bad, int *
default:
log_error("Unknown or bad option '%c' (0x%x)", option, (unsigned) option);
retval = -1;
break;
}
}
+4 -10
View File
@@ -66,8 +66,6 @@ static void set_usb_iftype(char *to, int if_class_num, size_t len) {
break;
case 0xff: /* Vendor-specific */
break;
default:
break;
}
strncpy(to, type, len);
to[len-1] = '\0';
@@ -77,7 +75,7 @@ static int set_usb_mass_storage_ifsubtype(char *to, const char *from, size_t len
int type_num = 0;
const char *type = "generic";
if (safe_atoi(from, &type_num) >= 0) {
if (safe_atoi(from, &type_num) >= 0)
switch (type_num) {
case 1: /* RBC devices */
type = "rbc";
@@ -94,10 +92,8 @@ static int set_usb_mass_storage_ifsubtype(char *to, const char *from, size_t len
case 6: /* Transparent SPC-2 devices */
type = "scsi";
break;
default:
break;
}
}
strscpy(to, len, type);
return type_num;
}
@@ -106,7 +102,7 @@ static void set_scsi_type(char *to, const char *from, size_t len) {
unsigned type_num;
const char *type = "generic";
if (safe_atou(from, &type_num) >= 0) {
if (safe_atou(from, &type_num) >= 0)
switch (type_num) {
case 0:
case 0xe:
@@ -123,10 +119,8 @@ static void set_scsi_type(char *to, const char *from, size_t len) {
case 5:
type = "cd";
break;
default:
break;
}
}
strscpy(to, len, type);
}