mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
seq: Avoid strlcat()
strlcat() isn't available in every system, so better to avoid it.
Rewrite the code without strlcat().
Fixes: 6167b8ce3e ("seq: Add API helper functions for creating UMP Endpoint and Blocks")
Link: https://lore.kernel.org/0796c157-1ac3-47a3-9d54-ba86f59d64d5@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
f090a93ea8
commit
d969439813
1 changed files with 6 additions and 6 deletions
|
|
@ -635,6 +635,7 @@ static void update_group_ports(snd_seq_t *seq, snd_ump_endpoint_info_t *ep)
|
||||||
char blknames[64];
|
char blknames[64];
|
||||||
char name[64];
|
char name[64];
|
||||||
unsigned int caps = 0;
|
unsigned int caps = 0;
|
||||||
|
int len;
|
||||||
|
|
||||||
blknames[0] = 0;
|
blknames[0] = 0;
|
||||||
for (b = 0; b < ep->num_blocks; b++) {
|
for (b = 0; b < ep->num_blocks; b++) {
|
||||||
|
|
@ -668,14 +669,13 @@ static void update_group_ports(snd_seq_t *seq, snd_ump_endpoint_info_t *ep)
|
||||||
|
|
||||||
if (!*bp->name)
|
if (!*bp->name)
|
||||||
continue;
|
continue;
|
||||||
if (*blknames) {
|
len = strlen(blknames);
|
||||||
strlcat(blknames, ", ", sizeof(blknames));
|
if (len)
|
||||||
strlcat(blknames, (const char *)bp->name,
|
snprintf(blknames + len, sizeof(blknames) - len,
|
||||||
sizeof(blknames));
|
", %s", bp->name);
|
||||||
} else {
|
else
|
||||||
snd_strlcpy(blknames, (const char *)bp->name,
|
snd_strlcpy(blknames, (const char *)bp->name,
|
||||||
sizeof(blknames));
|
sizeof(blknames));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!*blknames)
|
if (!*blknames)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue