mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tests: Use g_strdup_printf() instead of virAsprintf()
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
@@ -62,8 +62,7 @@ static int testFDStreamReadCommon(const char *scratchdir, bool blocking)
|
||||
for (i = 0; i < PATTERN_LEN; i++)
|
||||
pattern[i] = i;
|
||||
|
||||
if (virAsprintf(&file, "%s/input.data", scratchdir) < 0)
|
||||
goto cleanup;
|
||||
file = g_strdup_printf("%s/input.data", scratchdir);
|
||||
|
||||
if ((fd = open(file, O_CREAT|O_WRONLY|O_EXCL, 0600)) < 0)
|
||||
goto cleanup;
|
||||
@@ -194,8 +193,7 @@ static int testFDStreamWriteCommon(const char *scratchdir, bool blocking)
|
||||
for (i = 0; i < PATTERN_LEN; i++)
|
||||
pattern[i] = i;
|
||||
|
||||
if (virAsprintf(&file, "%s/input.data", scratchdir) < 0)
|
||||
goto cleanup;
|
||||
file = g_strdup_printf("%s/input.data", scratchdir);
|
||||
|
||||
if (!(st = virStreamNew(conn, flags)))
|
||||
goto cleanup;
|
||||
|
||||
Reference in New Issue
Block a user