diff --git a/ascon.c b/ascon.c index b64c914d..2f6a51c2 100644 --- a/ascon.c +++ b/ascon.c @@ -587,6 +587,11 @@ AsconStatus AsconTask(Ascon * a) } a->state = AsconReadStart; break; + case AsconReading: + if (result != 0) { + break; /* char received: try again, probably more characters pending */ + } + return AsconPending; case AsconReadDone: a->state = AsconIdle; a->responseValid = 1; @@ -609,10 +614,7 @@ AsconStatus AsconTask(Ascon * a) } return AsconFailure; default: - if (result) { - return AsconPending; - } - break; + return AsconPending; } } } diff --git a/ascon.i b/ascon.i index e8bdd0ef..7ee8b375 100644 --- a/ascon.i +++ b/ascon.i @@ -84,7 +84,7 @@ struct Ascon { * value should be 1 * when the state was AsconReading, a 1 indicates that a character was read * and the character is stored in the lastChar field. A 0 indicates - * that no charater was read. + * that no character was read. * * * In most cases a custom handler may be a wrapper around AsconBaseHandler