From 8be9578c8eae4ec204b8374001f8e5a0c541a38d Mon Sep 17 00:00:00 2001 From: Nicolas <33007491+metita@users.noreply.github.com> Date: Sun, 19 Jul 2026 19:59:00 -0400 Subject: [PATCH] fix: setAmxString cutting off last character of strings --- reapi/src/amxxmodule.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/reapi/src/amxxmodule.cpp b/reapi/src/amxxmodule.cpp index 2ea1ee86..090dd28d 100644 --- a/reapi/src/amxxmodule.cpp +++ b/reapi/src/amxxmodule.cpp @@ -238,13 +238,11 @@ char* getAmxString(cell* src, char* dest, size_t max, size_t* len) void setAmxString(cell* dest, const char* string, size_t max) { - if (!dest || max == 0) + if (!dest) return; - // reserve 1 cell for term null - size_t limit = max - 1; - - while (*string && limit--) + // max is the number of chars without the terminator, like charsmax() in Pawn + while (*string && max--) *dest++ = (cell)*string++; *dest = 0;