summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWojciech Siewierski <wojciech.siewierski@onet.pl>2017-05-04 01:19:05 +0200
committerWojciech Siewierski <wojciech.siewierski@onet.pl>2017-05-04 01:26:35 +0200
commit436d661775178fb62b46afdc3d755fdb413dcb35 (patch)
treeda4962debe39bfcb208558878fe67b76edd7b0c6
parent5e2a9992783e584f66dfeef16abf9d31c976311a (diff)
dynamic_macro.h: Fix an off-by-two error
We need to check whether we just passed the after-the-end point of the other macro. Instead we were checking whether we are going to reach it now.
-rw-r--r--quantum/dynamic_macro.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/quantum/dynamic_macro.h b/quantum/dynamic_macro.h
index c9120897f8..9e7845c992 100644
--- a/quantum/dynamic_macro.h
+++ b/quantum/dynamic_macro.h
@@ -99,14 +99,14 @@ void dynamic_macro_play(
*
* @param macro_buffer[in] The start of the used macro buffer.
* @param macro_pointer[in,out] The current buffer position.
- * @param macro_end2[in] The end of the other macro which shouldn't be overwritten.
+ * @param macro2_end[in] The last buffer element it is safe to use before overwriting the other macro.
* @param direction[in] Either +1 or -1, which way to iterate the buffer.
* @param record[in] The current keypress.
*/
void dynamic_macro_record_key(
keyrecord_t *macro_buffer,
keyrecord_t **macro_pointer,
- keyrecord_t *macro_end2,
+ keyrecord_t *macro2_end,
int8_t direction,
keyrecord_t *record)
{
@@ -115,7 +115,7 @@ void dynamic_macro_record_key(
return;
}
- if (*macro_pointer + direction != macro_end2) {
+ if (*macro_pointer - direction != macro2_end) {
**macro_pointer = *record;
*macro_pointer += direction;
} else {