bugfix: allow stray spaces at the end of network definitions.

This commit is contained in:
Alexandre Snarskii
2014-07-27 15:01:03 +04:00
parent 6cd1083c51
commit 857c3dc15d
4 changed files with 16 additions and 11 deletions

View File

@@ -2,6 +2,7 @@
#include "config.h"
#endif
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -56,7 +57,7 @@ sx_prefix_parse(struct sx_prefix* p, int af, char* text)
char* eod;
*c=0;
masklen=strtol(c+1,&eod,10);
if(eod[0]) {
if(eod && eod[0] && !isspace(eod[0])) {
*c='/';
sx_report(SX_ERROR,"Invalid masklen in prefix %s\n", text);
goto fixups;