Skip to content

fix: to_num_from_stream pointer position correction #1000

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/stdlib_str2num.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ module stdlib_str2num
integer(int8) :: err
!----------------------------------------------
call to_num_base(s,v,p,err)
p = min( p , len(s, kind = int8) )
p = min( p , len(s) )
Copy link
Member

Choose a reason for hiding this comment

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

As p is declared as integer(int8), similar issues might still happen. Maybe also declare p as integer :: p? Or do you think it is not needed?

Copy link
Contributor Author

@jalvesz jalvesz Jun 8, 2025

Choose a reason for hiding this comment

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

It is not needed as the kind is converted as an output of min. It could happen if an individual number is written on more than 127 characters. But even a quad number would fit.

s => s(p:)
if(present(stat)) stat = err
end function
Expand Down
Loading