pipewire,remoting,tests: Replace asprintf w/ str_printf

We have a string helper which wraps asprintf(). Uses that one because it
clears out the destination string, but also it won't return the number
of bytes unlinke asprintf().

Fixes warnings like:
warning: ignoring return value of ‘asprintf’ declared with attribute
‘warn_unused_result’.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad
2022-03-08 15:30:04 +02:00
parent 3e94836a63
commit d284ab0322
3 changed files with 24 additions and 19 deletions
+2 -1
View File
@@ -29,6 +29,7 @@
#include "backend.h"
#include "libweston-internal.h"
#include "shared/timespec-util.h"
#include "shared/string-helpers.h"
#include <libweston/backend-drm.h>
#include <libweston/weston-log.h>
@@ -550,7 +551,7 @@ pipewire_output_create(struct weston_compositor *c, char *name)
output->pipewire = pipewire;
wl_list_insert(pipewire->output_list.prev, &output->link);
asprintf(&remoting_name, "%s-%s", connector_name, name);
str_printf(&remoting_name, "%s-%s", connector_name, name);
weston_head_init(head, remoting_name);
weston_head_set_subpixel(head, WL_OUTPUT_SUBPIXEL_NONE);
weston_head_set_monitor_strings(head, make, model, serial_number);