Skip to content

fix: json negative integers parsing bug#292

Open
bukowa wants to merge 1 commit intovdemydiuk:masterfrom
bukforks:fixjsonint
Open

fix: json negative integers parsing bug#292
bukowa wants to merge 1 commit intovdemydiuk:masterfrom
bukforks:fixjsonint

Conversation

@bukowa
Copy link
Copy Markdown

@bukowa bukowa commented Jan 22, 2026

fix #291
works for me

Gemini 3 after giving the code and asking if there's a bug in negative integer parsing:

image

@tudstudent
Copy link
Copy Markdown

Fix is correct — the int i=_pos needs to be after the sign-handling block so the digit loop starts at the first actual digit, not the -/+ character.

Note: mq5/json.mqh has the exact same bug at the equivalent line. This PR fixes MQL4 only. The same one-line fix (i=_pos; after the sign block) should also be applied to mq5/json.mqh for MT5 parity.

@tudstudent
Copy link
Copy Markdown

For reference: our PR #297 includes this negative int parsing fix for MQL4 plus the equivalent fix needed in MQL5's json.mqh, along with 6 other bug fixes. If you'd prefer a single merge that covers everything, #297 is the combined option.

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.

"OBJECT" methods not working correctly in MT4

2 participants