I have a program that makes a database of file signatures, using stat. I have a record of useful information and dump this, including the time last modified as an array of 50 characters, which i store the ctime of the time last modified into, which is about 25 characters. my problem is when i dump the signature record into my database file using fwrite, itll dump an extra 25bytes of crap after the time string, so that wen i compare this string to another ctime generated string that is exactly the same, the memory after it is different, as it is random bytes from memory. i have tried using strncpy strcpy memcpy memccpy etc. and cannot get it working. i dont expect anyone to write my code :P jus a tip as to wat function could help would be nice. im using C in linux if it matters. thanks a lot.