incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <Travis.Vi...@roguewave.com>
Subject RE: Null src pointer in memcpy?
Date Fri, 11 Apr 2008 01:02:23 GMT


>-----Original Message-----
>From: Eric Lemings [mailto:Eric.Lemings@roguewave.com] 
>Sent: Thursday, April 10, 2008 5:42 PM
>To: dev@stdcxx.apache.org
>Subject: Null src pointer in memcpy?
>
> 
>Is it safe to pass a null pointer as the 2nd argument to memcpy()?  Or
>undefined?
>

The function is documented to copy n bytes from s2 into s1. If n is
non-zero, then it must attempt to copy that many bytes from s2. So it is
safe only when the third parameter is 0.

>Brad.
> 
>

Mime
View raw message