iio: Simplify iioutils_break_up_name()
Use g_auto() to simplify the memory management.
This commit is contained in:
@@ -55,7 +55,7 @@ struct iio_channel_info {
|
|||||||
static char *
|
static char *
|
||||||
iioutils_break_up_name (const char *name)
|
iioutils_break_up_name (const char *name)
|
||||||
{
|
{
|
||||||
char **items, *ret;
|
g_auto(GStrv) items = NULL;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
items = g_strsplit (name, "_", -1);
|
items = g_strsplit (name, "_", -1);
|
||||||
@@ -66,10 +66,7 @@ iioutils_break_up_name (const char *name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = g_strjoinv ("_", items);
|
return g_strjoinv ("_", items);
|
||||||
g_strfreev (items);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user