On 2/10/2015 4:04 PM, Eric Auer wrote: > Hi Franta, > >> I got the impression that string declared as >> >> char mystring[]="$DOSEMU$"; >> >> is in memory stored as null-terminated string. > This does not help you: The OTHER string STARTS > with "$DOSEMU$", but is NOT null terminated, so > both strings still differ. Unless you explicitly > say you only want to compare the first 8 bytes. > In short, you still have to use strncmp() here. > Sorry, that what was I meant in my previous reply, bad wording on my part. The recommendation still stands, as you are comparing a fixed length "array of characters", just use that fixed length in the call to strncmp(), just as Eric mentioned...
Ralf --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Freedos-user mailing list Freedos-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-user