skip empty input lines
This commit is contained in:
2
plageq.c
2
plageq.c
@@ -195,8 +195,8 @@ int main(void) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int l = strlen(s);
|
int l = strlen(s);
|
||||||
|
if (l && s[l - 1] == '\n') s[--l] = 0;
|
||||||
if (!l) continue;
|
if (!l) continue;
|
||||||
if (s[l - 1] == '\n') s[l - 1] = 0;
|
|
||||||
if (!strchr(s, ':')) {
|
if (!strchr(s, ':')) {
|
||||||
// ipv4
|
// ipv4
|
||||||
ip42bits(s, b, &m);
|
ip42bits(s, b, &m);
|
||||||
|
|||||||
@@ -175,8 +175,8 @@ int main(void) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int l = strlen(s);
|
int l = strlen(s);
|
||||||
|
if (l && s[l - 1] == '\n') s[--l] = 0;
|
||||||
if (!l) continue;
|
if (!l) continue;
|
||||||
if (s[l - 1] == '\n') s[l - 1] = 0;
|
|
||||||
if (!strchr(s, ':')) {
|
if (!strchr(s, ':')) {
|
||||||
// ipv4
|
// ipv4
|
||||||
ip42bits(s, b, &m);
|
ip42bits(s, b, &m);
|
||||||
|
|||||||
Reference in New Issue
Block a user