From 10406c73b385c7f536cb737d87680e691a80b508 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Jan 2014 23:10:24 +0100 Subject: SongSave: make variables more local --- src/SongSave.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/SongSave.cxx b/src/SongSave.cxx index c2e3afce5..18ac63d12 100644 --- a/src/SongSave.cxx +++ b/src/SongSave.cxx @@ -60,15 +60,13 @@ song_load(TextFile &file, Directory *parent, const char *uri, Song *song = parent != nullptr ? Song::NewFile(uri, parent) : Song::NewRemote(uri); - char *line, *colon; - TagType type; - const char *value; TagBuilder tag; + char *line; while ((line = file.ReadLine()) != nullptr && strcmp(line, SONG_END) != 0) { - colon = strchr(line, ':'); + char *colon = strchr(line, ':'); if (colon == nullptr || colon == line) { song->Free(); @@ -78,8 +76,9 @@ song_load(TextFile &file, Directory *parent, const char *uri, } *colon++ = 0; - value = strchug_fast(colon); + const char *value = strchug_fast(colon); + TagType type; if ((type = tag_name_parse(line)) != TAG_NUM_OF_ITEM_TYPES) { tag.AddItem(type, value); } else if (strcmp(line, "Time") == 0) { -- cgit v1.2.3