Well, i uploaded my code to a unix system and complied it with cc It worked, flawlessly! I guess that means the problem is in my compiler, Symantec Think C! I guess now I'll post in the comp.sys.mac.programmer newsgroup to find out why the compiler does this. Thanks for the help anyway. Stas