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

introduce CHANNELLEN and convert some strncpy + \0 into strlcpy() #567

Merged
merged 11 commits into from
Oct 13, 2018

Conversation

michaelortmann
Copy link
Member

@michaelortmann michaelortmann commented Aug 21, 2018

Found by: michaelortmann
Patch by: michaelortmann
Fixes: enhancement only patch

One-line summary:
introduce CHANNELLEN and convert some strncpy + \0 into strlcpy()

Additional description (if needed):
we had some irc discussion about #3 and #38, this patch here should be fine as is.

Test cases demonstrating functionality (if applicable):

test case 1 (actually here are 2 places checked at once):
i startet eggdrop, invited it to a +i channel and it worked fine.
i also put 2 debug printf()s into source for test only and got:
DEBUG: sizeof last_invchan = 81
and
DEBUG: sizeof chan->name = 81
(the first DEBUG is for the invite, the second for the join)

test case 2:
.+chan #test
worked fine
i also put a debug printf() into source for test only and got:
DEBUG: sizeof chan->dname = 81

test case 3:
.+chan #test2
.tcl addchanrec -HQ #test2
Tcl: 1
i also put a debug printf() into source for test only and got:
DEBUG: sizeof ch->channel = 81

test case 4:
.dcc list
[02:46:06] #-HQ# dccstat
[...]
1 0.0.0.0 0 -HQ chat flags: cptEp/0
[..]
.tcl console 1 #test mkcoblxs
Tcl: {#test} mkcoblxs
i did .dcc list to find out idx = 1 parameter for the following .tcl console
i also put a debug printf() into source for test only and got:
DEBUG: sizeof dcc[i].u.chat->con_chan = 81

test case 5:
.stick
i also put a debug printf() into source for test only and got:
DEBUG: sizeof chname = 81

@Cizzle
Copy link
Member

Cizzle commented Aug 22, 2018

LGTM, though there's still a lot more places with the hardcoded 81.

@michaelortmann
Copy link
Member Author

michaelortmann commented Aug 23, 2018

i did some more places.
enough for now.
because i fear, if i did even more, this pull request would become too bloated to be merged.

@michaelortmann michaelortmann changed the title Gotinvite strncpyz introduce CHANNELLEN and convert some strncpy + \0 into strncpyz() Aug 25, 2018
@Cizzle
Copy link
Member

Cizzle commented Oct 8, 2018

LGTM

@Cizzle Cizzle added this to the v1.8.4 milestone Oct 8, 2018
@vanosg
Copy link
Member

vanosg commented Oct 9, 2018

build

src/mod/channels.mod/tclchan.c Outdated Show resolved Hide resolved
src/mod/channels.mod/userchan.c Outdated Show resolved Hide resolved
src/mod/irc.mod/chan.c Outdated Show resolved Hide resolved
src/mod/irc.mod/chan.c Outdated Show resolved Hide resolved
@michaelortmann michaelortmann changed the title introduce CHANNELLEN and convert some strncpy + \0 into strncpyz() introduce CHANNELLEN and convert some strncpy + \0 into strlcpy() Oct 9, 2018
@michaelortmann
Copy link
Member Author

@Cizzle: requested changes were done.

@vanosg
Copy link
Member

vanosg commented Oct 13, 2018

build

@vanosg vanosg merged commit af9c128 into eggheads:develop Oct 13, 2018
@michaelortmann michaelortmann deleted the gotinvite-strncpyz branch October 13, 2018 18:12
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

Successfully merging this pull request may close these issues.

3 participants