aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2013-06-14 00:07:20 +0000
committerDimitri Sokolyuk <demon@dim13.org>2013-06-14 00:07:20 +0000
commit842899267b64539c3071a26842ace597ad063d91 (patch)
treeccc0f1c9b62ab653ffbbc506995c2af41669156f
parent149c6099c2c25ceefe69e026533a7297a5de684f (diff)
fix buffer overflow
-rw-r--r--spectrogram.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/spectrogram.c b/spectrogram.c
index d968434..7fd51d9 100644
--- a/spectrogram.c
+++ b/spectrogram.c
@@ -163,7 +163,7 @@ createbg(struct data *data)
sp_right.x, sp_right.y);
}
-#define LIMIT(val, maxval) ((val) > (maxval) ? (maxval) : (val))
+#define LIMIT(val, maxval) ((val) >= (maxval) ? ((maxval) - 1) : (val))
int
draw(struct data *data)