Paolo Bonzini wrote:
>> Unfortunately that's not possible in the case of virStrcpyStatic(). Because
>> virStrcpyStatic() does a sizeof(dest), you have to have the original char
>> foo[123], not a char *, to get something meaningful. That means that it has
>> to
>> either be a macro or not exist
Unfortunately that's not possible in the case of virStrcpyStatic(). Because
virStrcpyStatic() does a sizeof(dest), you have to have the original char
foo[123], not a char *, to get something meaningful. That means that it has to
either be a macro or not exist at all. (I could be convinced of th
On Tue, Sep 22, 2009 at 04:16:51PM +0200, Chris Lalancette wrote:
> Daniel Veillard wrote:
> > On Tue, Sep 22, 2009 at 02:23:26PM +0200, Chris Lalancette wrote:
> >> Add the virStrncpy function, which takes a dst string, source string,
> >> the number of bytes to copy and the number of bytes availa
Daniel Veillard wrote:
> On Tue, Sep 22, 2009 at 02:23:26PM +0200, Chris Lalancette wrote:
>> Add the virStrncpy function, which takes a dst string, source string,
>> the number of bytes to copy and the number of bytes available in the
>> dest string. If the source string is too large to fit into
On Tue, Sep 22, 2009 at 02:23:26PM +0200, Chris Lalancette wrote:
> Add the virStrncpy function, which takes a dst string, source string,
> the number of bytes to copy and the number of bytes available in the
> dest string. If the source string is too large to fit into the
> destination string, in
Add the virStrncpy function, which takes a dst string, source string,
the number of bytes to copy and the number of bytes available in the
dest string. If the source string is too large to fit into the
destination string, including the \0 byte, then no data is copied and
the function returns NULL.
Matthias Bolte wrote:
>> diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
>> index 0225e9a..24c4422 100644
>> --- a/src/esx/esx_driver.c
>> +++ b/src/esx/esx_driver.c
>> @@ -694,9 +694,12 @@ esxNodeGetInfo(virConnectPtr conn, virNodeInfoPtr
>> nodeinfo)
>> ++ptr;
>>
2009/8/28 Chris Lalancette :
> Add the virStrncpy function, which takes a dst string, source string,
> the number of bytes to copy and the number of bytes available in the
> dest string. If the source string is too large to fit into the
> destination string, including the \0 byte, then no data is
+ - virStrcpy(char *dest, const char *src, size_t destbytes)
+ Use this variant if you know you want to copy the entire src string
+ into dest. This is equivalent to
+ virStrncpy(dest, src, strlen(src), destbytes)
+
+ - virStrcpyStatic(char *dest, const char *src)
+ Use this
Add the virStrncpy function, which takes a dst string, source string,
the number of bytes to copy and the number of bytes available in the
dest string. If the source string is too large to fit into the
destination string, including the \0 byte, then no data is copied and
the function returns NULL.
10 matches
Mail list logo