1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 04:30:33 +00:00

Fix compilation in gcc

This commit is contained in:
Carles Fernandez 2017-05-12 19:40:51 +02:00
parent c804fb8d6f
commit 44ba718de4

View File

@ -58,11 +58,9 @@
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h> #include <sys/time.h>
#define __USE_MISC
#include <errno.h> #include <errno.h>
#include <termios.h> #include <termios.h>
#include <sys/socket.h> #include <sys/socket.h>
//#include <netinet/in.h>
#include <netinet/tcp.h> #include <netinet/tcp.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
@ -101,7 +99,7 @@ serial_t *openserial(const char *path, int mode, char *msg)
if (!(serial = (serial_t *)malloc(sizeof(serial_t)))) return NULL; if (!(serial = (serial_t *)malloc(sizeof(serial_t)))) return NULL;
if ((p = strchr(path, ':'))) if ((p = strchr((char*)path, ':')))
{ {
strncpy(port, path, p-path); port[p-path] = '\0'; strncpy(port, path, p-path); port[p-path] = '\0';
sscanf(p, ":%d:%d:%c:%d:%s", &brate, &bsize, &parity, &stopb, fctr); sscanf(p, ":%d:%d:%c:%d:%s", &brate, &bsize, &parity, &stopb, fctr);