--------------------------------------------------------------------------- | Facility : libnform | Function : static bool Check_AlphaNumeric_Field( | FIELD *field, | const void *argp) | | Description : Validate buffer content to be a valid alphanumeric value | | Return Values : TRUE - field is
| 82 | | FALSE - field is invalid |
| 83 | +--------------------------------------------------------------------------*/ |
| 84 | static bool Check_AlphaNumeric_Field(FIELD * field, const void * argp) |
| 85 | { |
| 86 | int width = ((const alnumARG *)argp)->width; |
| 87 | unsigned char *bp = (unsigned char *)field_buffer(field,0); |
| 88 | int l = -1; |
| 89 | unsigned char *s; |
| 90 | |
| 91 | while(*bp && *bp==' ') |
| 92 | bp++; |
| 93 | if (*bp) |
| 94 | { |
| 95 | s = bp; |
| 96 | while(*bp && isalnum(*bp)) |
| 97 | bp++; |
| 98 | l = (int)(bp-s); |
| 99 | while(*bp && *bp==' ') |
| 100 | bp++; |
| 101 | } |
| 102 | return ((*bp || (l < width)) ? FALSE : TRUE); |
| 103 | } |
| 104 | |
| 105 | /*--------------------------------------------------------------------------- |
| 106 | | Facility : libnform |
nothing calls this directly
no test coverage detected
searching dependent graphs…