mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-17 06:04:23 +03:00
cleanup: singlenode minor change
Use strcpy instead of sprintf for plain string. And use dm_strncpy for safer strncpy. TODO: Fix API return values for cluster functions.
This commit is contained in:
parent
8ab4334505
commit
a266154e1f
@ -136,7 +136,7 @@ static int _csid_from_name(char *csid, const char *name)
|
||||
|
||||
static int _name_from_csid(const char *csid, char *name)
|
||||
{
|
||||
sprintf(name, "SINGLENODE");
|
||||
strcpy(name, "SINGLENODE");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -284,9 +284,8 @@ static int _cluster_send_message(const void *buf, int msglen,
|
||||
|
||||
static int _get_cluster_name(char *buf, int buflen)
|
||||
{
|
||||
strncpy(buf, "localcluster", buflen);
|
||||
buf[buflen - 1] = 0;
|
||||
return 0;
|
||||
/* FIXME - cluster_ops API is broken - swap 1/0 */
|
||||
return dm_strncpy(buf, "localcluster", buflen) ? 0 : 1;
|
||||
}
|
||||
|
||||
static struct cluster_ops _cluster_singlenode_ops = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user