www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics



c++ - unexpected characters

↑ ↓ ← Paul <wcount12 aol.com> writes:
Hi, ive tried twice to attach screen shots (jpegs) but unsucessful,
so here is what im seeing when the crash/error occurs in the array
"raw_data" used to read in the data.

expected:  '12''\''02''\''2006'

unexpected: '2''9''\12'\0''2'1\''2006'

Paul
Apr 09 2007
↑ ↓ Bertel Brander <bertel post4.tele.dk> writes:
Paul skrev:
 Hi, ive tried twice to attach screen shots (jpegs) but unsucessful,
 so here is what im seeing when the crash/error occurs in the array
 "raw_data" used to read in the data.
 
 expected:  '12''\''02''\''2006'
 
 unexpected: '2''9''\12'\0''2'1\''2006'

Can we have the definition of "struct proform"? We might need open_file as well, all in all, a complete program would be nice. My guess is that you have a buffer overrun. You could change all strcpy to strncpy and check length in fill_temp. The source and .txt files are only readable from the web-interface. -- Just another homepage: http://damb.dk But it's mine - Bertel
Apr 09 2007
↑ ↓ Paul <wcount12 aol.com> writes:
Hi Bertel, please find attached the complete
program! (sorry) Ive added the header file
at the bottom of the program listing.  It
includes the definition of struct proform
and the function open_file.

I much appreciate your efforts.

Paul
Apr 09 2007
↑ ↓ → Bertel Brander <bertel post4.tele.dk> writes:
Paul skrev:
 Hi Bertel, please find attached the complete
 program! (sorry) Ive added the header file
 at the bottom of the program listing.  It
 includes the definition of struct proform
 and the function open_file.

I can't spot any immediate error in the code. I can't make it to fail based on the data I have. The code is not very robust, a malformed line can cause the program to fail. The code seiems to do the same again and again in a loop, the only variance is the input file, so I would expect that t is a special line in the file that cause the program to fail. One way to narrow down the cause of the fail would be to study the line just before and the current line when the program fails. If I can have a file that cause the problem, I can try to debug the program, my email address is valid. -- Just another homepage: http://damb.dk But it's mine - Bertel
Apr 10 2007