diff --git a/NEWS b/NEWS index d783b342..884ec813 100644 --- a/NEWS +++ b/NEWS @@ -13,9 +13,14 @@ ncmpcpp-0.7 (????-??-??) * Multiple configuration files via command line arguments are now accepted. In addition, by default ncmpcpp attempts to read both $HOME/.ncmpcpp/config and $XDG_CONFIG_HOME/ncmpcpp/config (in this order). * Support for PDCurses has been removed due to the library being unmaintained and buggy. -ncmpcpp-0.6.2 (????-??-??) +ncmpcpp-0.6.3 (????-??-??) + +* Fix floating point exception when adding a specific number of random items. + +ncmpcpp-0.6.2 (2014-12-13) * Delete key now aditionally binds by default to action that deletes files in browser. +* Fix incremental seeking so that it doesn't reset after 30 seconds. ncmpcpp-0.6.1 (2014-11-06) diff --git a/src/actions.cpp b/src/actions.cpp index 25bd5c7d..b90c17ec 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -2623,7 +2623,7 @@ void seek() Status::trace(); unsigned howmuch = Config.incremental_seeking - ? (Timer-t).seconds()/2+Config.seek_time + ? (Timer-t).total_seconds()/2+Config.seek_time : Config.seek_time; Key input = Key::read(*wFooter); diff --git a/src/mpdpp.cpp b/src/mpdpp.cpp index 089bab97..863b2a6b 100644 --- a/src/mpdpp.cpp +++ b/src/mpdpp.cpp @@ -531,7 +531,7 @@ bool Connection::AddRandomTag(mpd_tag_type tag, size_t number) return false; std::random_shuffle(tags.begin(), tags.end()); - auto it = tags.begin()+rand()%(tags.size()-number); + auto it = tags.begin(); for (size_t i = 0; i < number && it != tags.end(); ++i) { StartSearch(true); @@ -571,7 +571,7 @@ bool Connection::AddRandomSongs(size_t number) { std::random_shuffle(files.begin(), files.end()); StartCommandsList(); - auto it = files.begin()+rand()%(std::max(size_t(1), files.size()-number)); + auto it = files.begin(); for (size_t i = 0; i < number && it != files.end(); ++i, ++it) AddSong(*it); CommitCommandsList();