Commit 94a484c2 authored by spiiroin's avatar spiiroin

[usb-moded] Normalize use of sizeof operator

As 'sizeof' is not a function, do not make it look like one.

Also 'sizeof(char)' is redundant as it is 1 by definition.
Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
parent fdc32b06
......@@ -340,7 +340,7 @@ static char * config_get_kcmdline_string(const char *entry)
return(ret);
}
len = read(fd, cmdLine, sizeof(cmdLine) - 1);
len = read(fd, cmdLine, sizeof cmdLine - 1);
close(fd);
if (len <= 0)
......
......@@ -105,7 +105,7 @@ char * mac_read_mac(void)
fclose(g_ether);
return 0;
}
mac = malloc(sizeof(char) *17);
mac = malloc(17);
if(mac)
read = fread(mac, 1, 17, g_ether);
if(read == 17)
......
......@@ -344,8 +344,8 @@ end:
static int network_checklink(void)
{
int ret = -1;
char dest[sizeof(UDHCP_CONFIG_PATH)+1];
size_t len = readlink(UDHCP_CONFIG_LINK, dest, sizeof(dest)-1);
char dest[sizeof UDHCP_CONFIG_PATH + 1];
size_t len = readlink(UDHCP_CONFIG_LINK, dest, sizeof dest - 1);
if (len > 0)
{
......@@ -384,8 +384,8 @@ static int network_write_udhcpd_conf(ipforward_data_t *ipforward, mode_list_elem
}
/* generate start and end ip based on the setting */
ip = config_get_network_setting(NETWORK_IP_KEY);
ipstart = malloc(sizeof(char)*15);
ipend = malloc(sizeof(char)*15);
ipstart = malloc(15);
ipend = malloc(15);
while(i < 15)
{
if(dot < 3)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment