Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check that isascii() is true before doing any other isXXXXX() test
The IRAF libc maintaines the array of character types as a `char[128]`. So, any test that uses this array should ensure that the argument is in this range. This is now done by preceding all tests with `isascii(c) &&`. Do avoid side effects by using the argument twice, the macros are converted into normal functions. This solution basically means that everything above 127 is neither a alphabetical value nor a punctuation mark; not even printable. However, the tests in this range are locale specific, which is not handled anyway by IRAF. The best solution here would however be to rely on the system libc `isXXXXX()` tests; however they may be defined as macros in `/usr/include/ctype.h`, which makes it difficult to include in an IRAF libc function.
- Loading branch information
Showing
2 changed files
with
62 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters