Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code duplication #1612

Open
michaelortmann opened this issue Jun 13, 2024 · 0 comments
Open

Code duplication #1612

michaelortmann opened this issue Jun 13, 2024 · 0 comments

Comments

@michaelortmann
Copy link
Member

eggdrop/src/cmds.c

Lines 906 to 913 in d58f563

if (strlen(addr) > 60)
addr[60] = 0;
/* Trim IPv6 []s out if present */
if (addr[0] == '[') {
addr[strlen(addr)-1] = 0;
memmove(addr, addr + 1, strlen(addr));
}

eggdrop/src/cmds.c

Lines 1264 to 1268 in d58f563

/* Trim IPv6 []s out if present */
if (addr[0] == '[') {
addr[strlen(addr)-1] = 0;
memmove(addr, addr + 1, strlen(addr));
}

src/mod/server.mod/server.c](

eggdrop/src/tcluser.c

Lines 411 to 420 in d58f563

if ((count = strlen(addr)) > 60) {
count = 60;
addr[count] = 0;
}
/* Trim IPv6 []s out if present */
if (braced) {
--count;
addr[count] = 0;
memmove(addr, addr + 1, count);
}
)

The code is slightly different but looks like it does the very same and should be de-duplicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant