Changeset c62129c5 in rtems
- Timestamp:
- 09/02/15 21:54:25 (7 years ago)
- Branches:
- 4.11
- Children:
- 631d254
- Parents:
- 1491f694
- git-author:
- Martin Galvan <martin.galvan@…> (09/02/15 21:54:25)
- git-committer:
- Joel Sherrill <joel.sherrill@…> (09/03/15 16:27:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libnetworking/rtems/rtems_dhcp.c
r1491f694 rc62129c5 395 395 len = MAXHOSTNAMELEN-1; 396 396 } 397 if (sethostname (p, len) < 0) 397 if (sethostname (p, len) < 0) { 398 398 printf ("dhcpc: can't set host name"); 399 } 399 400 if (dhcp_hostname != NULL) 400 401 { 401 dhcp_hostname = realloc (dhcp_hostname, len); 402 strncpy (dhcp_hostname, p, len); 403 } 404 else 402 char *tmp = realloc (dhcp_hostname, len); 403 if (tmp != NULL) { 404 dhcp_hostname = tmp; 405 strncpy (dhcp_hostname, p, len); 406 } else { /* realloc failed */ 407 printf ("dhcpc: realloc failed (%s:%d)", __FILE__, __LINE__); 408 free (dhcp_hostname); 409 dhcp_hostname = NULL; 410 } 411 } else { /* dhcp_hostname == NULL */ 405 412 dhcp_hostname = strndup (p, len); 413 } 406 414 break; 407 415
Note: See TracChangeset
for help on using the changeset viewer.