Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated text-functionality.c #10956

Closed
wants to merge 1 commit into from

Conversation

Anurag-Modak
Copy link

uppdated load_text_from_file function

Description

Motivation and Context

How Has This Been Tested?

Types of changes

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

uppdated load_text_from_file function
Copy link
Member

@derrod derrod left a comment

Choose a reason for hiding this comment

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

  • Fill out the PR template
  • Fix the formatting
  • Fix the commit message

@kkartaltepe
Copy link
Collaborator

If you are interested in working on this please read the previous discussions on what is actually required to fix the issue, #7595 (comment)

@Anurag-Modak
Copy link
Author

If you are interested in working on this please read the previous discussions on what is actually required to fix the issue, #7595 (comment)

Can you elaborate the issue to me

Comment on lines +421 to +425
srcdata->text = bzalloc(filesize);
bytes_read = fread(srcdata->text, filesize - 2, 1, tmp_file);

// Ensure null-termination of the string
srcdata->text[(filesize - 2) / sizeof(wchar_t)] = L'\0';
Copy link
Contributor

Choose a reason for hiding this comment

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

bzalloc initialize the allocated region with 0.
Why was this line added?

@WizardCM WizardCM added the Bug Fix Non-breaking change which fixes an issue label Jul 13, 2024
@kkartaltepe
Copy link
Collaborator

Thanks for the interest in the issue, but im going to close this since I have gone ahead to implement the fix I was intending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants