Boost logo

Boost Users :

Subject: Re: [Boost-users] Strange issue with boost::date_time
From: Igor R (boost.lists_at_[hidden])
Date: 2009-04-15 19:54:50


> Hmm, wow, ok I think you were right, but it was really subtle. :(
>
> //String is read in from file, delimited.
> char string[32];
> File.getline(string, 32, '"');
>
> int Length = strlen(string); //  <-- Does not include Null character!
> char* Name = new char[Length]; //  <-- One char too small
> strcpy(Name, string); //  <-- Corrupted 1 byte after Name's end.
>

Well... it's just an additional proof to what was said in the parallel thread :)
http://article.gmane.org/gmane.comp.lib.boost.user/46803


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net