Re: [newbie] strcpy, strtok and strcat problem...
- From: pere.noel@xxxxxxxxxxxxxxxxxxx (Une bévue)
- Date: Thu, 31 Aug 2006 21:03:00 +0200
CBFalconer <cbfalconer@xxxxxxxxx> wrote:
You have some problems here. First, strtok is not a standard
function, and even the various implementations have problems, such
as lack of re-entrancy, fouling the original string, failure to
detect omitted tokens, etc. In addition strcpy and strcat are
inherently unsafe, and are much better replaced by the BSD proposed
strlcpy and strlcat routines. You can get these last two, in
portable standard C, at:
<http://cbfalconer.home.att.net/download/>
I have also written a replacement for strtok without the faults,
but simultaneously with different characteristics. Note that it
includes a conditionally compiled testing mechanism. Its source
follows:
ok, fine, thanks for all, i'll examine that asap !!!
--
une bévue
.
- References:
- [newbie] strcpy, strtok and strcat problem...
- From: Une bévue
- Re: [newbie] strcpy, strtok and strcat problem...
- From: CBFalconer
- [newbie] strcpy, strtok and strcat problem...
- Prev by Date: Re: [newbie] strcpy, strtok and strcat problem...
- Next by Date: Convert 00010000 to 11110000......how?
- Previous by thread: Re: [newbie] strcpy, strtok and strcat problem...
- Next by thread: Re: [newbie] strcpy, strtok and strcat problem...
- Index(es):
Relevant Pages
|