Skip to content

xml writing strings with newlines doesn't respect max buffer length #82

@bernstei

Description

@bernstei

Can anyone explain the logic of this if statem and the block it controls?

if (i>0) then

I'm finding that fortran (gfortran 9.4 on linux, specifically), complains about an end of record when I try to write a string with long lines (~2500 characters) separated by newlines, with the error in line 221.

From what I can tell, i (calculated in the previous source line) is the location of the newline, arbitrarily far into the string, so an arbitrarily large integer. As a result, the write statement that runs if a newline is found (i > 0) writes an arbitrarily long string to the file (from current location n to n+i-2).

I think some other logic is supposed to be used (maybe just put this if clause after the one that checks against MAX_BUF_SIZE?), but I don't quite understand what's supposed to be happening.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions