diff options
author | Max Kellermann <max@duempel.org> | 2014-08-29 23:46:38 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-29 23:46:38 +0200 |
commit | d5287682d14c0f6e99ba721fa844fd29d90b583a (patch) | |
tree | a63d4fd35015d289659580cfac9c7e841eef7d1f /src | |
parent | 7c567e3cbd2cc136ee029cf9300f73eb8f1118c6 (diff) | |
download | mpd-d5287682d14c0f6e99ba721fa844fd29d90b583a.tar.gz mpd-d5287682d14c0f6e99ba721fa844fd29d90b583a.tar.xz mpd-d5287682d14c0f6e99ba721fa844fd29d90b583a.zip |
ArgParser: allow fractional seconds in ParseCommandArg(SongTime)
Diffstat (limited to '')
-rw-r--r-- | src/protocol/ArgParser.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/protocol/ArgParser.cxx b/src/protocol/ArgParser.cxx index 709d12962..e3a0c107c 100644 --- a/src/protocol/ArgParser.cxx +++ b/src/protocol/ArgParser.cxx @@ -191,8 +191,8 @@ check_float(Client &client, float *value_r, const char *s) bool ParseCommandArg(Client &client, SongTime &value_r, const char *s) { - unsigned value; - bool success = check_unsigned(client, &value, s); + float value; + bool success = check_float(client, &value, s) && value >= 0; if (success) value_r = SongTime::FromS(value); @@ -202,8 +202,8 @@ ParseCommandArg(Client &client, SongTime &value_r, const char *s) bool ParseCommandArg(Client &client, SignedSongTime &value_r, const char *s) { - int value; - bool success = check_int(client, &value, s); + float value; + bool success = check_float(client, &value, s); if (success) value_r = SignedSongTime::FromS(value); |