Skip to content

Commit

Permalink
Correct _write function return
Browse files Browse the repository at this point in the history
  • Loading branch information
cassy73 authored Jan 3, 2017
1 parent 3fd815d commit a532bc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions UIPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ UIPClient::stop()
_dumpAllData();
#endif
}
#if ACTLOGLEVEL>=LOG_DEBUG
#if ACTLOGLEVEL>=LOG_DEBUG_V3
else
{
LogObject.uart_send_strln(F("UIPClient::stop() DEBUG:stop(), data: NULL"));
LogObject.uart_send_strln(F("UIPClient::stop() DEBUG_V3:stop(), data: NULL"));
}
#endif
data = NULL;
Expand Down Expand Up @@ -194,7 +194,7 @@ UIPClient::write(const uint8_t *buf, size_t size)
return _write(data, buf, size);
}

int16_t
uint16_t
UIPClient::_write(uip_userdata_t* u, const uint8_t *buf, size_t size)
{
#if ACTLOGLEVEL>=LOG_DEBUG_V3
Expand Down Expand Up @@ -271,7 +271,8 @@ UIPClient::_write(uip_userdata_t* u, const uint8_t *buf, size_t size)
#endif
return size-remain;
}
return -1;
//return -1; -1 is wrong because return type is unsigned
return 0;
}

int
Expand Down
2 changes: 1 addition & 1 deletion UIPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ typedef struct {
static uip_userdata_t all_data[UIP_CONNS];
static uip_userdata_t* _allocateData();

static int16_t _write(uip_userdata_t *,const uint8_t *buf, size_t size);
static uint16_t _write(uip_userdata_t *,const uint8_t *buf, size_t size);
static int _available(uip_userdata_t *);

static uint8_t _currentBlock(memhandle* blocks);
Expand Down

0 comments on commit a532bc1

Please sign in to comment.