Skip to content

Commit

Permalink
devinfo: Remove useless casts
Browse files Browse the repository at this point in the history
  • Loading branch information
ktullavik committed Oct 20, 2024
1 parent e244d73 commit 0f668e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions usr.sbin/devinfo/devinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ print_resource(struct devinfo_res *res)
hexmode = (rman->dm_size > 1000) || (rman->dm_size == 0);
end = res->dr_start + res->dr_size - 1;

safe_desc = (char*) malloc(strlen(rman->dm_desc));
safe_desc = malloc(strlen(rman->dm_desc));
strcpy(safe_desc, rman->dm_desc);
xml_safe_string(safe_desc);

Expand Down Expand Up @@ -191,7 +191,7 @@ print_device_rman_resources(struct devinfo_rman *rman, void *arg)

/* there are, print header */

safe_desc = (char*) malloc(strlen(rman->dm_desc));
safe_desc = malloc(strlen(rman->dm_desc));
strcpy(safe_desc, rman->dm_desc);
xml_safe_string(safe_desc);

Expand Down Expand Up @@ -356,7 +356,7 @@ print_rman(struct devinfo_rman *rman, void *arg __unused)
{
char* safe_desc;

safe_desc = (char*) malloc(strlen(rman->dm_desc));
safe_desc = malloc(strlen(rman->dm_desc));
strcpy(safe_desc, rman->dm_desc);
xml_safe_string(safe_desc);

Expand Down

0 comments on commit 0f668e6

Please sign in to comment.