On Fri, Dec 23, 2016 at 08:26:44AM +0100, Fabiano Fidêncio wrote:
> The strings in the ISO header ("volume-id", "system-id", "publisher-id"
> and "application-id") have a predefined size and are padded with spaces,
> but nothing in on_{pvd,svd}_read() removes these padding spaces from
> those strings, which makes osinfo_media_get_volume_id() always return
> [SOME-ISO-LABEL ] rather than the expected
> [SOME-ISO-LABEL].
>
> Resolves: rhbz#1408271
>
> Signed-off-by: Fabiano Fidêncio <[email protected]>
> Reported-by: Allan Day <[email protected]>
> ---
> osinfo/osinfo_media.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/osinfo/osinfo_media.c b/osinfo/osinfo_media.c
> index b45f4f4..af4bb14 100644
> --- a/osinfo/osinfo_media.c
> +++ b/osinfo/osinfo_media.c
> @@ -712,6 +712,7 @@ static void on_svd_read(GObject *source,
>
>
> data->svd.system[MAX_SYSTEM - 1] = 0;
> + g_strchomp(data->svd.system);
>
> if (strncmp(BOOTABLE_TAG, data->svd.system, sizeof(BOOTABLE_TAG)) != 0) {
> g_set_error(&error,
> @@ -803,9 +804,16 @@ static void on_pvd_read(GObject *source,
> }
>
> data->pvd.volume[MAX_VOLUME - 1] = 0;
> + g_strchomp(data->pvd.volume);
> +Even simpler to fix than I had thought, I had totally forgotten about g_strchomp() :) Acked-by: Christophe Fergeau <[email protected]> Christophe > data->pvd.system[MAX_SYSTEM - 1] = 0; > + g_strchomp(data->pvd.system); > + > data->pvd.publisher[MAX_PUBLISHER - 1] = 0; > + g_strchomp(data->pvd.publisher); > + > data->pvd.application[MAX_APPLICATION - 1] = 0; > + g_strchomp(data->pvd.application); > > if (is_str_empty(data->pvd.volume)) { > g_set_error(&error, > -- > 2.9.3 > > _______________________________________________ > Libosinfo mailing list > [email protected] > https://www.redhat.com/mailman/listinfo/libosinfo
signature.asc
Description: PGP signature
_______________________________________________ Libosinfo mailing list [email protected] https://www.redhat.com/mailman/listinfo/libosinfo
