rem: if (tmp+1-buffer<len){
add: tmp++; if (tmp-buffer<len){
context: char* parse_via_body(char* buffer,unsigned int len, struct via_body * vb){	/* format: sent-proto sent-by  *(";" params) [comment] 	           sent-proto = name"/"version"/"transport		   sent-by    = host [":" port]		   	*/	char* tmp;	char *name,*version, *transport, *comment, *params, *hostport;	char * next_via;	char * host;	short int port;	int offset;		name=version=transport=comment=params=hostport=next_via=host=0;	name=eat_space(buffer, len);	if (name-buffer==len) goto error;	offset=name-buffer;	tmp=name;	version=eat_token2(tmp,len-offset,'/');	if (version+1-buffer>=len) goto error;	*version=0;	version++;	offset+=version-tmp;		transport=eat_token2(tmp,len-offset,'/');	if (transport+1-buffer>=len) goto error;	*transport=0;	transport++;	offset+=transport-tmp;		tmp=eat_token(transport,len-offset);	if (tmp+1-buffer>=len) goto error;	*tmp=0;	tmp++;	offset+=tmp-transport;		hostport=eat_space(tmp,len-offset);	if (hostport+1-buffer>=len) goto error;	offset+=hostport-tmp;	/* find end of hostport */ 	for(tmp=hostport; (tmp-buffer)<len &&			(*tmp!=' ')&&(*tmp!=';')&&(*tmp!=','); tmp++);	if (tmp-buffer<len){		switch (*tmp){			case ' ':				*tmp=0;				/*the rest is comment? */				if (tmp+1-buffer<len){					tmp++;					comment=tmp;					/* eat the comment */					for(;((tmp-buffer)<len)&&						(*tmp!=',');tmp++);					/* mark end of compact via (also end of comment)*/					if (tmp-buffer<len){						*tmp=0;					}else break;					/* eat space & ',' */					for(tmp=tmp+1;((tmp-buffer)<len)&&						(*tmp==' '|| *tmp==',');tmp++);									}				break;			case ';':				*tmp=0;				if (tmp+1-buffer>=len) goto error;				tmp++;				params=tmp;				/* eat till end, first space  or ',' */				for(;((tmp-buffer)<len)&&					(*tmp!=' '&& *tmp!=',');tmp++);				if (tmp-buffer==len)  break;				if (*tmp==' '){					/* eat comment */					*tmp=0;					tmp++;					comment=tmp;					for(;((tmp-buffer)<len)&&						(*tmp!=',');tmp++);					if (tmp-buffer==len)  break;				}				/* mark end of via*/				*tmp=0;				/* eat space & ',' */				for(tmp=tmp+1;((tmp-buffer)<len)&&					(*tmp==' '|| *tmp==',');tmp++);				break;			case ',':				*tmp=0;				if (tmp+1-buffer<len){					/* eat space and ',' */					for(tmp=tmp+1; 						((tmp-buffer)<len)&&						(*tmp==' '|| *tmp==',');					   tmp++);				}		}	}	/* if we are not at the end of the body => we found another compact via */	if (tmp-buffer<len) next_via=tmp;		/* parse hostport */	parse_hostport(hostport, &host, &port);	vb->name=name;	vb->version=version;	vb->transport=transport;	vb->host=host;	vb->port=port;	vb->params=params;	vb->comment=comment;	vb->next=next_via;	vb->error=VIA_PARSE_OK;		/* tmp points to end of body or to next via (if compact)*/		return tmp;error:	vb->error=VIA_PARSE_ERROR;	return tmp;}