Skip to content

Fix calls to pro_input from trupdate, adding null termination#1159

Merged
rdemaria merged 1 commit into
MethodicalAcceleratorDesign:masterfrom
jsberg-bnl:trrun-pro_input
Mar 1, 2023
Merged

Fix calls to pro_input from trupdate, adding null termination#1159
rdemaria merged 1 commit into
MethodicalAcceleratorDesign:masterfrom
jsberg-bnl:trrun-pro_input

Conversation

@jsberg-bnl

Copy link
Copy Markdown
Collaborator

trupdate gives random errors since argument to pro_input is not null-terminated. Added the null termination and rewrote a bit.

I'm being a bit neurotic here, using iso_c_binding to call C from Fortran properly.
Really the interfaces should be put in an include file or module, but this is the only occurrence of this usage at the moment.
Ideally the code base switches from what is being done in mad_extern_f.h and mad_types_f.h to using iso_c_binding, but that's a larger undertaking.

Crash since argument to pro_input is not null-terminated
Used iso_c_binding to call C from Fortran properly
Really the interfaces should be put in an include file or module,
but this is the only occurrence of this usage at the moment.
@rdemaria

rdemaria commented Mar 1, 2023

Copy link
Copy Markdown
Contributor

It passes the test locally on my machine, therefore I accept it.

@rdemaria rdemaria merged commit 73dc7a9 into MethodicalAcceleratorDesign:master Mar 1, 2023
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