Thread overview | ||||||
---|---|---|---|---|---|---|
|
April 09, 2007 unexpected characters | ||||
---|---|---|---|---|
| ||||
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 |
April 09, 2007 Re: unexpected characters | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul | 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 |
April 09, 2007 Re: unexpected characters | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bertel Brander Attachments: | 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 |
April 10, 2007 Re: unexpected characters | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul | 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 |
Copyright © 1999-2021 by the D Language Foundation