aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-10 17:05:03 +0100
committerMax Kellermann <max@duempel.org>2009-01-10 17:05:03 +0100
commitb7c4b78846cf2eba35517a1a0c435a3a056636f5 (patch)
tree1d417f421229bf5739bba394b44c45291e7eb75c /src/playlist.c
parent6f0781f0396ab5e4bc8aece6986381dac8f03081 (diff)
downloadmpd-b7c4b78846cf2eba35517a1a0c435a3a056636f5.tar.gz
mpd-b7c4b78846cf2eba35517a1a0c435a3a056636f5.tar.xz
mpd-b7c4b78846cf2eba35517a1a0c435a3a056636f5.zip
playlist: exclude end of range
In a range "start:end", "end" itself should not be included. Use the same semantics as other languages implementing ranges, e.g. Python.
Diffstat (limited to '')
-rw-r--r--src/playlist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/playlist.c b/src/playlist.c
index e6dd1cac0..f2cbf161f 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -425,7 +425,7 @@ enum playlist_result playlistInfo(struct client *client, int song, int max)
if (song >= (int)playlist.length)
return PLAYLIST_RESULT_BAD_RANGE;
if (max > 0) {
- end = MIN((unsigned)(max + 1), playlist.length);
+ end = MIN((unsigned)max, playlist.length);
if (end <= begin)
return PLAYLIST_RESULT_BAD_RANGE;
}