Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions reapi/src/amxxmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading