kopia lustrzana https://github.com/Hamlib/Hamlib
Fix compile warnings for src
rodzic
20d1818af4
commit
1e883d0195
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
int gpio_open(hamlib_port_t *port, int on_value)
|
int gpio_open(hamlib_port_t *port, int on_value)
|
||||||
{
|
{
|
||||||
char pathname[FILPATHLEN];
|
char pathname[FILPATHLEN*2];
|
||||||
FILE *fexp, *fdir;
|
FILE *fexp, *fdir;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ int gpio_open(hamlib_port_t *port, int on_value)
|
||||||
fclose(fexp);
|
fclose(fexp);
|
||||||
|
|
||||||
snprintf(pathname,
|
snprintf(pathname,
|
||||||
FILPATHLEN,
|
sizeof(pathname),
|
||||||
"/sys/class/gpio/gpio%s/direction",
|
"/sys/class/gpio/gpio%s/direction",
|
||||||
port->pathname);
|
port->pathname);
|
||||||
fdir = fopen(pathname, "w");
|
fdir = fopen(pathname, "w");
|
||||||
|
@ -73,7 +73,7 @@ int gpio_open(hamlib_port_t *port, int on_value)
|
||||||
fclose(fdir);
|
fclose(fdir);
|
||||||
|
|
||||||
snprintf(pathname,
|
snprintf(pathname,
|
||||||
FILPATHLEN,
|
sizeof(pathname),
|
||||||
"/sys/class/gpio/gpio%s/value",
|
"/sys/class/gpio/gpio%s/value",
|
||||||
port->pathname);
|
port->pathname);
|
||||||
fd = open(pathname, O_WRONLY);
|
fd = open(pathname, O_WRONLY);
|
||||||
|
|
|
@ -173,7 +173,7 @@ int network_open(hamlib_port_t *rp, int default_port)
|
||||||
{
|
{
|
||||||
if (strlen(rp->pathname))
|
if (strlen(rp->pathname))
|
||||||
{
|
{
|
||||||
strncpy(hostname, rp->pathname, FILPATHLEN - 1);
|
snprintf(hostname, sizeof(hostname), "%s", rp->pathname);
|
||||||
hoststr = hostname;
|
hoststr = hostname;
|
||||||
/* look for IPv6 numeric form [<addr>] */
|
/* look for IPv6 numeric form [<addr>] */
|
||||||
bracketstr1 = strchr(hoststr, '[');
|
bracketstr1 = strchr(hoststr, '[');
|
||||||
|
|
Ładowanie…
Reference in New Issue