EPANET icon indicating copy to clipboard operation
EPANET copied to clipboard

Max number of characters in description field

Open BlomTbl opened this issue 1 year ago • 3 comments

For a project use the description field to store the path of a tag. Since this field is maximized to 255 characters, my question is whether there is a way to increase the number of characters.

BlomTbl avatar Oct 17 '24 13:10 BlomTbl

I believe you would have to increase the value assigned to the MAXMSG constant in types.h and then re-build the toolkit. However the maximum path length on Windows is 256 characters (unless you change a registry setting), so maybe increasing MAXMSG isn't necessary. But on Linux it's 4095 characters.

LRossman avatar Oct 17 '24 14:10 LRossman

@BlomTbl @LRossman I suppose we can close this issue, as it is a windows limitation?

eldemet avatar Mar 30 '25 19:03 eldemet

Aside from file path lengths, this issue suggests that the limitations on the size of comment and tag strings be removed. I believe this can be done with the current code base since dynamic strings are used to save comments and tags in a project's data base using the xstrcpy function in project.c. Currently xstrcpy uses its last argument to limit the size of the string it creates, which is MAXMSG for comments and tags. But this can be modified so that if the size parameter is 0 then the destination string is created with the same size as the source string being copied.

Therefore I recommend that this issue not be closed and perhaps labelled as an enhancement.

LRossman avatar Mar 31 '25 16:03 LRossman