Skip to content

Conversation

@NexiusTailer
Copy link
Contributor

@NexiusTailer NexiusTailer commented Jan 1, 2026

The changes are made in Pawn VM only (not in the compiler):

  1. Fix for pretty critical bug in memcpy function: the change was made in this commit, so now offset is applied to source instead of dest. This way, the function memcpy in omp server still have bounds checking for destination array only, and we could be reading out of bounds from the source array if we set invalid index parameter
  2. Fix indentation inside strins function. There should be 2 spaces instead of 4 like everywhere else
  3. Re-add missed comment inside flength which was in original repo previously, fix typo in comment for "PAWN_CELL_SIZE 64"
  4. Minor format fixes of the recently changed stuff to match the general style

Most of format tweaks were made on purpose, to reduce unnecessary differences in diff checker when comparing it with other forks based on original Pawn repo.

@NexiusTailer NexiusTailer force-pushed the master branch 12 times, most recently from 2be6cdc to cb5c820 Compare January 2, 2026 12:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses several important fixes and formatting corrections to align the codebase with the original PAWN repository style:

  • Fixes a critical bug in the memcpy function where the offset was incorrectly applied to the source pointer instead of the destination pointer, potentially causing out-of-bounds reads
  • Corrects indentation throughout the strins function from 4 spaces to 2 spaces for consistency with the rest of the codebase
  • Re-adds a missing comment and fixes a typo in a comment describing cell size

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
source/amx/amxstring.c Fixes critical bug in memcpy (offset now applied to destination instead of source); fixes indentation in strins function from 4 spaces to 2 spaces
source/amx/amxfloat.c Removes extraneous blank line between comment and code in n_floatfract
source/amx/amxfile.c Re-adds missing comment in flength function; adjusts spacing for consistency
source/amx/amxcore.c Minor spacing adjustments in function signatures and parameters for consistency
source/amx/amx.h Fixes typo in comment ("32-bit cells" → "64-bit cells" for __64BIT__ case); reformats multi-line comment to single line
source/amx/amx.c Minor spacing adjustments around operators and in blank lines for consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NexiusTailer
Copy link
Contributor Author

NexiusTailer commented Jan 2, 2026

I'm sorry for not creating a new PR and adding more stuff here, but it's quite tiny if proposing separately:

  1. Fix fwrite skipping last symbol if the passed string is packed
  2. Comparing to pawn-lang/compiler, some stuff like amx_PushString and amx_SetString was rewritten, adding internal amx_PushStringLen and amx_SetStringLen. After the commit e5b7d1a, the code here became inconsistent when calculating string length under different compiler options. Now it's also fixed
  3. All the natives previously ported from Pawn 4 are now present in the reference .inc libraries
  4. Internal links in readme were updated to ones pointing to this repo files instead of pawn-lang/compiler

@NexiusTailer NexiusTailer force-pushed the master branch 6 times, most recently from 28cbd70 to 321f1e4 Compare January 11, 2026 01:57
Comment on lines +33 to +35
native bool: fcopy(const source[], const target[]);
native bool: frename(const oldname[], const newname[]);
native bool: fcreatedir(const name[]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these implemented in the amx runtime omp uses too?

@Southclaws Southclaws merged commit 5904ab8 into openmultiplayer:master Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants