diff --git a/glfw/internal.h b/glfw/internal.h index 7cee164af..9b6d50b9f 100644 --- a/glfw/internal.h +++ b/glfw/internal.h @@ -199,7 +199,7 @@ typedef void (APIENTRY * PFN_vkVoidFunction)(void); #define remove_i_from_array(array, i, count) { \ count--; \ if (i < count) { \ - memmove(array + i, array + i + 1, sizeof(array[0]) * (count - 1)); \ + memmove(array + i, array + i + 1, sizeof(array[0]) * (count - i)); \ }} // Constructs a version number string from the public header macros diff --git a/kitty/data-types.h b/kitty/data-types.h index 68f5a91fc..f9ce1e834 100644 --- a/kitty/data-types.h +++ b/kitty/data-types.h @@ -261,7 +261,7 @@ typedef struct {FONTS_DATA_HEAD} *FONTS_DATA_HANDLE; #define remove_i_from_array(array, i, count) { \ count--; \ if (i < count) { \ - memmove(array + i, array + i + 1, sizeof(array[0]) * (count - 1)); \ + memmove(array + i, array + i + 1, sizeof(array[0]) * (count - i)); \ }} // Global functions