ppp: fix implicit conversion from size_t to u8_t

Found when compiling with VS2017
This commit is contained in:
Simon Goldschmidt 2018-09-12 22:22:10 +02:00
parent bc48eb512e
commit bbf80b05c8
2 changed files with 3 additions and 3 deletions

View File

@ -236,7 +236,7 @@ static void terminate_layer(fsm *f, int nextstate) {
*/
void fsm_close(fsm *f, const char *reason) {
f->term_reason = reason;
f->term_reason_len = (reason == NULL? 0: LWIP_MIN(strlen(reason), 0xFF) );
f->term_reason_len = (reason == NULL? 0: (u8_t)LWIP_MIN(strlen(reason), 0xFF) );
switch( f->state ){
case PPP_FSM_STARTING:
f->state = PPP_FSM_INITIAL;

View File

@ -159,9 +159,9 @@ void upap_authwithpeer(ppp_pcb *pcb, const char *user, const char *password) {
/* Save the username and password we're given */
pcb->upap.us_user = user;
pcb->upap.us_userlen = LWIP_MIN(strlen(user), 0xff);
pcb->upap.us_userlen = (u8_t)LWIP_MIN(strlen(user), 0xff);
pcb->upap.us_passwd = password;
pcb->upap.us_passwdlen = LWIP_MIN(strlen(password), 0xff);
pcb->upap.us_passwdlen = (u8_t)LWIP_MIN(strlen(password), 0xff);
pcb->upap.us_transmits = 0;
/* Lower layer up yet? */