net: fix declaration after statement
Change-Id: I0302c363aac32a7d861773a14b1ba2d96979abbd Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/367122 Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
4671369ab2
commit
23d3f49e6c
@ -41,10 +41,12 @@
|
|||||||
|
|
||||||
static int get_addr_str(struct sockaddr_in *paddr, char *host, size_t hlen)
|
static int get_addr_str(struct sockaddr_in *paddr, char *host, size_t hlen)
|
||||||
{
|
{
|
||||||
|
uint8_t *pa;
|
||||||
|
|
||||||
if (paddr == NULL || host == NULL)
|
if (paddr == NULL || host == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
uint8_t *pa = (uint8_t *)&paddr->sin_addr.s_addr;
|
pa = (uint8_t *)&paddr->sin_addr.s_addr;
|
||||||
snprintf(host, hlen, "%u.%u.%u.%u", pa[0], pa[1], pa[2], pa[3]);
|
snprintf(host, hlen, "%u.%u.%u.%u", pa[0], pa[1], pa[2], pa[3]);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user