summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--payloads/libpayload/arch/mips/string.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/payloads/libpayload/arch/mips/string.c b/payloads/libpayload/arch/mips/string.c
index 0563cf82ac..6326d15994 100644
--- a/payloads/libpayload/arch/mips/string.c
+++ b/payloads/libpayload/arch/mips/string.c
@@ -47,11 +47,10 @@ void *memmove(void *dest, const void *src, size_t n)
if ((src < dest) && (dest - src < n)) {
u8 *ptr_d = dest;
const u8 *ptr_s = src;
- size_t i;
/* copy backwards */
- for (i = n - 1; i >= 0; i--)
- ptr_d[i] = ptr_s[i];
+ while (n--)
+ ptr_d[n] = ptr_s[n];
return dest;
}