Skip to content

fix: fs read NSInteger pointer issue#115

Open
superbogy wants to merge 1 commit intosourcetoad:masterfrom
superbogy:fix-read-params
Open

fix: fs read NSInteger pointer issue#115
superbogy wants to merge 1 commit intosourcetoad:masterfrom
superbogy:fix-read-params

Conversation

@superbogy
Copy link
Copy Markdown

issue: #114

Copy link
Copy Markdown

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

Fixes iOS RNFSManager.read failing to bridge numeric arguments from JS (issue #114) by correcting the Objective-C method signature and updating related numeric casts.

Changes:

  • Change read method parameters length and position from NSInteger * to NSInteger.
  • Update seekToFileOffset and readDataOfLength call sites to use wider integer casts (vs int).

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 316 to +320
return reject(@"EISDIR", @"EISDIR: Could not open file for reading", nil);
}

// Seek to the position if there is one.
[file seekToFileOffset: (int)position];
[file seekToFileOffset: (NSInteger)position];
if ((int)length > 0) {
content = [file readDataOfLength: (int)length];
if ((NSInteger)length > 0) {
content = [file readDataOfLength: (NSInteger)length];
@iBotPeaches
Copy link
Copy Markdown
Member

Thanks! I added Copilot, but your issue #114 confuses me. You are running 3.0.5 (FS2) which is pretty old (3+ years)? Was there a different issue you hit? Or was the RN lower version the reason?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants