skip empty input lines

This commit is contained in:
Alexander Zubkov
2021-12-01 17:15:43 +01:00
parent cf77903eaa
commit c3300e56ee
2 changed files with 2 additions and 2 deletions

View File

@@ -195,8 +195,8 @@ int main(void) {
break;
}
int l = strlen(s);
if (l && s[l - 1] == '\n') s[--l] = 0;
if (!l) continue;
if (s[l - 1] == '\n') s[l - 1] = 0;
if (!strchr(s, ':')) {
// ipv4
ip42bits(s, b, &m);

View File

@@ -175,8 +175,8 @@ int main(void) {
break;
}
int l = strlen(s);
if (l && s[l - 1] == '\n') s[--l] = 0;
if (!l) continue;
if (s[l - 1] == '\n') s[l - 1] = 0;
if (!strchr(s, ':')) {
// ipv4
ip42bits(s, b, &m);