If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > weird seg-fault errors

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-28-02, 14:07
somealien somealien is offline
Registered User
 
Join Date: May 2002
Location: MA
Posts: 4
Question weird seg-fault errors

I'm very confused. I'm writing a C program but keep getting segmentation faults when i get to the if-statement. the weirdest thing is that the program works if the statement ends up being true. i get the seg-faults when its false. here's the notorious if-statement:

if ( !strncmp( text, "ATOM ", 5) && text[13] != 'H' ) {
blah blah blah
}

thanks a lot to anyone who can help
Reply With Quote
  #2 (permalink)  
Old 05-28-02, 15:49
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
How is text defined ? What are examples of text ? What is the example when it fails ? Have you tried to split the if statement into 2 if statements - this would possibly eliminate one of the conditionals as being the problem ?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On