mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
spa: bluez: do not open-code asprintf()
This commit is contained in:
parent
605404c781
commit
f6ea5421e6
1 changed files with 1 additions and 3 deletions
|
|
@ -216,9 +216,7 @@ static void media_codec_switch_free(struct spa_bt_media_codec_switch *sw);
|
||||||
// Name of battery, formatted as /org/freedesktop/pipewire/battery/org/bluez/hciX/dev_XX_XX_XX_XX_XX_XX
|
// Name of battery, formatted as /org/freedesktop/pipewire/battery/org/bluez/hciX/dev_XX_XX_XX_XX_XX_XX
|
||||||
static char *battery_get_name(const char *device_path)
|
static char *battery_get_name(const char *device_path)
|
||||||
{
|
{
|
||||||
char *path = malloc(strlen(PIPEWIRE_BATTERY_PROVIDER) + strlen(device_path) + 1);
|
return spa_aprintf(PIPEWIRE_BATTERY_PROVIDER "%s", device_path);
|
||||||
sprintf(path, PIPEWIRE_BATTERY_PROVIDER "%s", device_path);
|
|
||||||
return path;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unregister virtual battery of device
|
// Unregister virtual battery of device
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue