Re: GREP



Malcolm McLean wrote:

.... snip ...

The standard can fix that

int testtext(char *str) {
while(*str) {
if(!isalpha( (unsigned int) *str) && !isspace( (unsigned int) *str))
return 0;
str++;
}
return 1;
}

To the OP, sorry about the horrid casts to int. They are needed
to fix up problems in the is.... functions when passed negative
chars.

Try simply receiving str as an unsigned char*

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.



--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • Re: GREP
    ... sorry about the horrid casts to int. ... to fix up problems in the is.... ... Try simply receiving str as an unsigned char* ... on chars. ...
    (comp.lang.c)
  • Re: truncation warning
    ... > int length; ... > How should I fix that? ... When i compiled in conforming mode I only got this - ...
    (comp.lang.c)
  • Re: ntpd: committed fix still contains buffer overrun
    ... place: int, unsigned, etc. Proper cast is one: (unsigned char) ... Please, fix. ...
    (FreeBSD-Security)
  • [git patches] net driver updates for .26
    ... Fix a bug where the pointer never moves for dma_unmap... ... Update and fix driver debugging messages ... int reset); ... * header structure can be anywhere in the mcp. ...
    (Linux-Kernel)
  • [git patches] net driver fixes
    ... Fix NAPI state bug when Rx complete ... const struct cmac_statistics *s; ... int flag) ...
    (Linux-Kernel)