diff --git a/ascon.c b/ascon.c index 6269a356..799417dc 100644 --- a/ascon.c +++ b/ascon.c @@ -53,16 +53,6 @@ static int CreateSocketAdress(struct sockaddr_in *sockaddrPtr, /* Socket addres return 1; } -double DoubleTime(void) -{ - struct timeval now; - /* the resolution of this function is usec, if the machine supports this - and the mantissa of a double is 51 bits or more (31 for sec and 20 for micro) - */ - gettimeofday(&now, NULL); - return now.tv_sec + now.tv_usec / 1e6; -} - void AsconError(Ascon *a, char *msg, int errorno) { static char *stateText[]={ @@ -455,6 +445,10 @@ int AsconStdHandler(Ascon * a) if (result == 0) return 0; chr = a->lastChar; + if (chr == '\0') { /* skip NUL characters */ + DynStringBackspace(a->rdBuffer); /* remove NUL */ + return 1; + } if (a->replyTerminator != NULL) { if (strchr(a->replyTerminator, chr) != NULL) { a->state = AsconReadDone; diff --git a/ascon.h b/ascon.h index b1974282..46372191 100644 --- a/ascon.h +++ b/ascon.h @@ -79,11 +79,6 @@ char *AsconGetError(Ascon *a); */ char *ConcatArgs(int argc, char *argv[]); -/** \brief function for dealing with times with microsec resolution - * \return absolute time as double value - */ -double DoubleTime(void); - /** \brief emit an error message. The state switches to AsconFailed. * \param a the connection * \param msg, a message to be emitted