Working on changes, maybe working?

This commit is contained in:
Charles Descamps 2024-01-31 18:17:38 -07:00
parent 7b837ddf86
commit 3af7742043
8 changed files with 127 additions and 74 deletions

View file

@ -227,9 +227,9 @@ bool getStringConstrained(FILE *inStream, bool clearLeadingNonPrintable,
// capture first value in stream using fgetc
intChar = fgetc(inStream);
// loop to clear non-printable or space if indicated
while((((intChar != EOF) &&
(clearLeadingNonPrintable && (intChar < (int)SPACE)))
|| (clearLeadingSpace && (intChar == (int)SPACE))))
while((intChar != EOF) &&
((clearLeadingNonPrintable && intChar < (int)SPACE)
|| (clearLeadingSpace && intChar == (int)SPACE)))
{
// get next character in stream using fgetc
intChar = fgetc(inStream);
@ -242,9 +242,9 @@ bool getStringConstrained(FILE *inStream, bool clearLeadingNonPrintable,
return false;
}
// loop to get input from file stream
while(((intChar != EOF && index < MAX_STR_LEN - 1) &&
(stopAtNonPrintable && intChar >= (int)SPACE))
|| ((!stopAtNonPrintable) && (intChar != (char)delimiter)))
while((intChar != EOF && index < MAX_STR_LEN - 1) &&
((stopAtNonPrintable && intChar >= (int)SPACE) || (!stopAtNonPrintable)) &&
(intChar != (char)delimiter))
{
// [continues if not at end of file and max string len not reached ]
// [AND continues if not printable flag set and characters printable ]