1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-26 06:36:38 +02:00
Files
unrealircd/include
Bram Matthys bb4758f321 Add strldup() and safestrldup(), reducing ridiculous amount of code in
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
+ */
2018-04-22 15:40:21 +02:00
..
2017-12-29 09:34:31 +01:00
2002-03-05 23:09:39 +00:00
2015-10-16 15:32:10 -07:00
2015-07-28 21:44:32 +02:00
2002-02-16 20:15:41 +00:00
2017-11-27 12:22:42 +01:00
2016-05-12 16:57:32 +08:00
2016-05-12 16:57:32 +08:00
2000-02-28 22:45:44 +00:00
2000-07-14 20:22:59 +00:00
2018-04-22 14:36:21 +02:00
2004-05-13 16:39:23 +00:00
2017-12-29 09:34:31 +01:00
2004-02-22 02:52:12 +00:00