[Asterisk-Dev] RE: [RFC] strncpy -> ast_copy_string

Jerris, Michael MI mjerris at ofllc.com
Mon May 2 08:02:42 MST 2005


> From: asterisk-dev-bounces at lists.digium.com 
> [mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Ledion B
> 
> Hey Kevin,
> 
> Can we see the code for your test_copy_string and test_strncpy.

>From the cvs mailing list:

+void ast_copy_string(char *dst, const char *src, size_t size)
+{
+	while (*src && size--)
+		*dst++ = *src++;
+	if (__builtin_expect(!size, 0))
+		dst--;
+	*dst = '\0';
+}

http://lists.digium.com/pipermail/asterisk-cvs/2005-May/date.html


http://lists.digium.com/pipermail/asterisk-cvs/2005-May/006091.html
http://lists.digium.com/pipermail/asterisk-cvs/2005-May/006090.html





More information about the asterisk-dev mailing list