mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-26 06:36:38 +02:00
bb4758f321
m_pass and m_topic.c when duplicating strings with a length limit. +/* strldup(str,max) copies a string and ensures the new buffer + * is at most 'max' size, including nul byte. The syntax is pretty + * much identical to strlcpy() except that the buffer is newly + * allocated. + * If you wonder why not use strndup() instead? + * I feel that mixing code with strlcpy() and strndup() would be + * rather confusing since strlcpy() assumes buffer size including + * the nul byte and strndup() assumes without the nul byte and + * will write one character extra. Hence this strldup(). -- Syzop + */