To: | |
---|---|
Subject: | Re: [ts-7000] strcmp function is generating segmentation fault |
From: | "Don W. Carr" <> |
Date: | Wed, 21 Feb 2007 16:12:35 -0600 |
First, strtok can return NULL if there are no more tokens, so you should check for NULL before using the string returned from strtok. But, the following is from the man page: Avoid using these functions. If you do use them, note that: These functions modify their first argument. These functions cannot be used on constant strings. The identity of the delimiting character is lost. The strtok() function uses a static buffer while parsing, so it's not thread safe. Use strtok_r() if this matters to you. Basically, stay clear of these, I have never seen anybody use them to write a program that did not crash at strange times.
On 2/21/07, cspin_2001 <> wrote:
|
<Prev in Thread] | Current Thread | [Next in Thread> |
---|---|---|
|
Previous by Date: | [ts-7000] strcmp function is generating segmentation fault, cspin_2001 |
---|---|
Next by Date: | Re: [ts-7000] opto-isolated RS232/485 for PC?, Joe Bouchard |
Previous by Thread: | [ts-7000] strcmp function is generating segmentation fault, cspin_2001 |
Next by Thread: | Re: [ts-7000] strcmp function is generating segmentation fault, Michael L Howard |
Indexes: | [Date] [Thread] [Top] [All Lists] |
Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU