ctb server: added brackets around char* in write to socket

This commit is contained in:
2018-11-21 15:57:46 +01:00
parent e98d60c26e
commit 4d0090dfcc
2 changed files with 4 additions and 4 deletions

View File

@ -31,9 +31,9 @@ int myport=-1;
//struct sockaddr_in address;
//#define VERBOSE
#define BLACKFIN_DRVR_SND_LMT 30000 // rough limit
#define BLACKFIN_RSND_PCKT_LOOP 10
#define BLACKFIN_RSND_WAIT_US (10 * 1000)
#define BLACKFIN_DRVR_SND_LMT (30000) // rough limit
#define BLACKFIN_RSND_PCKT_LOOP (10)
#define BLACKFIN_RSND_WAIT_US (1)
int bindSocket(unsigned short int port_number) {
int i;
@ -332,7 +332,7 @@ int sendDataOnly(int file_des, void* buf,int length) {
bytesToSend = BLACKFIN_DRVR_SND_LMT;
// send
int rc = write(file_des, (char*)buf + bytesSent, bytesToSend);
int rc = write(file_des, (char*)((char*)buf + bytesSent), bytesToSend);
// error
if (rc < 0) {
cprintf(BG_RED, "Error writing to socket. Possible socket crash\n");