From 4e2f4e2091103ea571602c444642ff04c2bf5a2f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 4 Dec 2014 17:43:01 +0100 Subject: util/StringUtil: add ToUpperASCII() Replaces g_ascii_strup() and allows building the Vorbis encoder without GLib. --- src/encoder/plugins/VorbisEncoderPlugin.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/encoder') diff --git a/src/encoder/plugins/VorbisEncoderPlugin.cxx b/src/encoder/plugins/VorbisEncoderPlugin.cxx index 3cc941220..01c9910a0 100644 --- a/src/encoder/plugins/VorbisEncoderPlugin.cxx +++ b/src/encoder/plugins/VorbisEncoderPlugin.cxx @@ -25,14 +25,13 @@ #include "tag/Tag.hxx" #include "AudioFormat.hxx" #include "config/ConfigError.hxx" +#include "util/StringUtil.hxx" #include "util/NumberParser.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" #include -#include - struct vorbis_encoder { /** the base class */ Encoder encoder; @@ -273,9 +272,9 @@ static void copy_tag_to_vorbis_comment(vorbis_comment *vc, const Tag &tag) { for (const auto &item : tag) { - char *name = g_ascii_strup(tag_item_names[item.type], -1); + char name[64]; + ToUpperASCII(name, tag_item_names[item.type], sizeof(name)); vorbis_comment_add_tag(vc, name, item.value); - g_free(name); } } -- cgit v1.2.3