www.digitalmars.com         C & C++   DMDScript  

c++ - unexpected characters

reply 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
parent reply 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
parent reply 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
begin 644 procon.c
M+RH *BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ
M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ
M*BHJ*BHJ* T*("` 4')O9W)A;2!T;R!C;VYV97)T(%!R;V9O<FT 8V]M;6$ 
M<V5P87)A=&5D(&]U='!U="!F:6QE+"!I;G1O(&)I;F%R>2!R96%D>2!F;W( 
M=&5S=&EN9R`R,"\P.2\P- T*("` *BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ
M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ

M:6\N:#X-"B-I;F-L=61E(#QS=&1L:6(N:#X-"B-I;F-L=61E(#QC;VYI;RYH
M/ T*(VEN8VQU9&4 /'-T<FEN9RYH/ T*(VEN8VQU9&4 (FAO<G-E<RYH( T*

M861E<B]C;VQU;6X ;&EN92!O;B!F:7)S="!L:6YE(&]F(&-S=BYT>'0 9FEL
M92!B969O<F4 <G5N;FEN9R!P<F]G<F%M("HJ*BHJ+PT*:6YT('!T<E]C='([


M("` (&-H87( <F%W7V1A=&%;,S4P72P-"B` ("` ("` ("` ("`J=&5M<%]P







































































M96UP7W!T<B`](&1A=&5?=&EM93L-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?
M<'1R+'1E;7!?<'1R*3L-"B` ("` ("` ('1E;7!?<'1R(#T 8V]U<G-E.PT*
M("` ("` ("` 9FEL;%]T96UP*')A=U]P='(L=&5M<%]P='(I.PT*("` ("` 
M("` =&5M<%]P='( /2!C;W5R<V5?9&ER96-T:6]N.PT*("` ("` ("` 9FEL
M;%]T96UP*')A=U]P='(L=&5M<%]P='(I.PT*("` ("` ("` =&5M<%]P='( 
M/2!C;W5R<V5?8VAA<F%C=&5R:7-T:6-S.PT*("` ("` ("` 9FEL;%]T96UP
M*')A=U]P='(L=&5M<%]P='(I.PT*("` ("` ("` =&5M<%]P='( /2!D:7-T
M86YC93L-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-
M"B` ("` ("` ('1E;7!?<'1R(#T

M8V5?='EP93L-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R
M*3L-"B` ("` ("` ('1E;7!?<'1R(#T <G5N;F5R<SL-"B` ("` ("` (&9I
M;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-"B` ("` ("` ('1E;7!?<'1R
M(#T <F%C95]C;&%S<SL-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E
M;7!?<'1R*3L-"B` ("` ("` ('1E;7!?<'1R(#T ;F5W7V-L87-S7VYU;3L-
M"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-"B` ("` 
M("` ('1E;7!?<'1R(#T ;6EN7V%G93L-"B` ("` ("` (&9I;&Q?=&5M<"AR
M87=?<'1R+'1E;7!?<'1R*3L-"B` ("` ("` ('1E;7!?<'1R(#T ;6%X7V%G
M93L-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-"B` 
M("` ("` ('1E;7!?<'1R(#T



M(&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-"B` ("` ("` ('1E;7!?
M<'1R(#T 8W-F.PT*("` ("` ("` 9FEL;%]T96UP*')A=U]P='(L=&5M<%]P
M='(I.PT*("` ("` ("` =&5M<%]P='( /2!G;VEN9SL-"B` ("` ("` (&9I
M;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-"B` ("` ("` ('1E;7!?<'1R
M(#T

M:6]N<SL-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-
M"B` ("` ("` ('1E;7!?<'1R(#T 9&%T93L-"B` ("` ("` (&9I;&Q?=&5M
M<"AR87=?<'1R+'1E;7!?<'1R*3L-"B` ("` ("` ('1E;7!?<'1R(#T <F%C
M95]T:6UE.PT*("` ("` ("` 9FEL;%]T96UP*')A=U]P='(L=&5M<%]P='(I





M7W!T<B`](&AO<G-E.PT*("` ("` ("` 9FEL;%]T96UP*')A=U]P='(L=&5M
M<%]P='(I.PT*("` ("` ("` =&5M<%]P='( /2!H;W)S95]C;W5N=')Y.PT*
M("` ("` ("` 9FEL;%]T96UP*')A=U]P='(L=&5M<%]P='(I.PT*("` ("` 


M;&%I;3L-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-
M"B` ("` ("` ('1E;7!?<'1R(#T =')A:6YE<CL-"B` ("` ("` (&9I;&Q?
M=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-"B` ("` ("` ('1E;7!?<'1R(#T 
M=&ES<W5E7W)A=&EN9SL-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E
M;7!?<'1R*3L-"B` ("` ("` ('1E;7!?<'1R(#T ;V1D<U]T97AT.PT*("` 
M("` ("` 9FEL;%]T96UP*')A=U]P='(L=&5M<%]P='(I.PT*("` ("` ("` 
M=&5M<%]P='( /2!O9&1S7W9A;'5E.PT*("` ("` ("` 9FEL;%]T96UP*')A


M("!T96UP7W!T<B`]('=E:6=H=#L-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?
M<'1R+'1E;7!?<'1R*3L-"B` ("` ("` ('1E;7!?<'1R(#T <&%C95]A8F)R



M"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-"B` ("` 
M("` ('1E;7!?<'1R(#T

M.PT*("` ("` ("` 9FEL;%]T96UP*')A=U]P='(L=&5M<%]P='(I.PT*("` 
M("` ("` =&5M<%]P='( /2!P<F]F;W)M7W-P965D7W)A=&EN9SL-"B` ("` 
M("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-"B` ("` ("` ('1E
M;7!?<'1R(#T 9&ES=%]T;U]N97AT.PT*("` ("` ("` 9FEL;%]T96UP*')A
M=U]P='(L=&5M<%]P='(I.PT*("` ("` ("` =&5M<%]P='( /2!D:7-T7W1O
M7W=I;FYE<CL-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R
M*3L-"B` ("` ("` ('1E;7!?<'1R(#T =7-E<E]R871I;F=?,3L ("` ("`O
M*B!U<V5R7W)A=&EN9R`Q("8 ,BP :V5P="!I;B!S;R!R96%D:6YG(&9R;VT 
M='AT(&9I;&4 :6X 8V]R<F5C="!O<F1E<B`J+PT*("` ("` ("` 9FEL;%]T
M96UP*')A=U]P='(L=&5M<%]P='(I.PT*("` ("` ("` =&5M<%]P='( /2!U
M<V5R7W)A=&EN9U\R.PT*("` ("` ("` 9FEL;%]T96UP*')A=U]P='(L=&5M
M<%]P='(I.PT*("` ("` ("` =&5M<%]P='( /2!U<V5R7W)A=&EN9U\S.PT*
M("` ("` ("` 9FEL;%]T96UP*')A=U]P='(L=&5M<%]P='(I.PT*("` ("` 
M("` =&5M<%]P='( /2!T:7-S=65?;V1D<U]T97AT.PT*("` ("` ("` 9FEL
M;%]T96UP*')A=U]P='(L=&5M<%]P='(I.PT*("` ("` ("` =&5M<%]P='( 
M/2!T:7-S=65?;V1D<U]V86QU93L-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?
M<'1R+'1E;7!?<'1R*3L-"B` ("` ("` ('1E;7!?<'1R(#T <')O9F]R;5]F
M;W)M7W)A=&EN9SL-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?
M<'1R*3L-"B` ("` ("` ('1E;7!?<'1R(#T =&ES7W!R9CL-"B` ("` ("` 
M(&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-"B` ("` ("` ('1E;7!?
M<'1R(#T


M("` ("` ("!T96UP7W!T<B`](&%V95]R871I;F=?86QL.PT*("` ("` ("` 
M9FEL;%]T96UP*')A=U]P='(L=&5M<%]P='(I.PT*("` ("` ("` =&5M<%]P
M='( /2!A=F5?<F%T:6YG7W1H<F5E.PT*("` ("` ("` 9FEL;%]T96UP*')A
M=U]P='(L=&5M<%]P='(I.PT*("` ("` ("` =&5M<%]P='( /2!M961I86Y?
M<F%T:6YG.PT*("` ("` ("` 9FEL;%]T96UP*')A=U]P='(L=&5M<%]P='(I
M.PT*("` ("` ("` =&5M<%]P='( /2!M961I86Y?<F%T:6YG7W1H<F5E.PT*
M("` ("` ("` 9FEL;%]T96UP*')A=U]P='(L=&5M<%]P='(I.PT*("` ("` 


M7W!T<B`]('9D=SL-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?
M<'1R*3L-"B` ("` ("` ('1E;7!?<'1R(#T :&EG:&5S=%]C;&%S<U]R871I

M("` ("` ("!T96UP7W!T<B`](')A8V5?8VQA<W-?;'1O.PT*("` ("` ("` 
M9FEL;%]T96UP*')A=U]P='(L=&5M<%]P='(I.PT*("` ("` ("` =&5M<%]P
M='( /2!N97=?8VQA<W-?;'1O.PT*("` ("` ("` 9FEL;%]T96UP*')A=U]P
M='(L=&5M<%]P='(I.PT*("` ("` ("` =&5M<%]P='( /2!D:7-T86YC95]L

M("` ("` ("!T96UP7W!T<B`]('9A;'5E7VQT;SL-"B` ("` ("` (&9I;&Q?
M=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-"B` ("` ("` ('1E;7!?<'1R(#T 
M<&]U;F1S7VQT;SL-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?
M<'1R*3L-"B` ("` ("` ('1E;7!?<'1R(#T 9FEN:7-H961?<F%C97-?<W([

M("` ("!T96UP7W!T<B`](')U;G-?8F5F;W)E.PT*("` ("` ("` 9FEL;%]T
M96UP*')A=U]P='(L=&5M<%]P='(I.PT*("` ("` ("` =&5M<%]P='( /2!W
M;VY?8F5F;W)E.PT*("` ("` ("` 9FEL;%]T96UP*')A=U]P='(L=&5M<%]P
M='(I.PT*("` ("` ("` =&5M<%]P='( /2!W;VY?<W)?8F5F;W)E.PT*("` 
M("` ("` 9FEL;%]T96UP*')A=U]P='(L=&5M<%]P='(I.PT*("` ("` ("` 
M=&5M<%]P='( /2!P<F]F:71?;&]S<SL-"B` ("` ("` (&9I;&Q?=&5M<"AR
M87=?<'1R+'1E;7!?<'1R*3L-"B` ("` ("` ('1E;7!?<'1R(#T <&QC7V)E
M9F]R93L-"B` ("` ("` (&9I;&Q?=&5M<"AR87=?<'1R+'1E;7!?<'1R*3L-
M"B` +RH ("` ("` =&5M<%]P='( /2!P;&-?<W)?8F5F;W)E.PT*("` ("` 

M("` ("` ("`O*B!I;G-E<G0 ;&]N9W, :6YT;R!S=')U8W0 *B\-" T*("` 
M("` ("` <')O7V1A=&$N=F%L=65?;'1O(#T 871O;"AV86QU95]L=&\I.PT*


M871O:2AR=6YN97)S*3L-"B` ("` ("` ('!R;U]D871A+FYE=U]C;&%S<U]N
M=6T ("` ("` (#T 871O:2AN97=?8VQA<W-?;G5M*3L-"B` ("` ("` ('!R
M;U]D871A+FUI;E]A9V4 ("` ("` ("` ("` (#T 871O:2AM:6Y?86=E*3L-
M"B` ("` ("` ('!R;U]D871A+FUA>%]A9V4 ("` ("` ("` ("` (#T 871O
M:2AM87A?86=E*3L-"B` ("` ("` ('!R;U]D871A+FAA;F1I8V%P7VQI;6ET
M("` ("` (#T
M9&%T82YR86-E8V%R9%]N=6T ("` ("` ("`](&%T;VDH<F%C96-A<F1?;G5M
M*3L-"B` ("` ("` ('!R;U]D871A+F1R87< ("` ("` ("` ("` ("` (#T 
M871O:2AD<F%W*3L-"B` ("` ("` ('!R;U]D871A+F9I;E]P;W, ("` ("` 
M("` ("` (#T 871O:2AF:6Y?<&]S*3L-"B` ("` ("` ('!R;U]D871A+FIO
M8VME>5]C;&%I;2` ("` ("` (#T 871O:2AJ;V-K97E?8VQA:6TI.PT*("` 
M("` ("` <')O7V1A=&$N=&ES<W5E7W)A=&EN9R` ("` ("` /2!A=&]I*'1I
M<W-U95]R871I;F<I.PT*("` ("` ("` <')O7V1A=&$N86=E("` ("` ("` 

M:'0 ("` ("` ("` ("` ("`](&%T;VDH=V5I9VAT*3L-"B` ("` ("` ('!R
M;U]D871A+F1S;'( ("` ("` ("` ("` ("` (#T 871O:2AD<VQR*3L-"B` 
M("` ("` ('!R;U]D871A+G!A8V5?<F%T:6YG("` ("` ("` (#T 871O:2AP

M("` ("` ("`](&%T;VDH;W(I.PT*("` ("` ("` <')O7V1A=&$N<')O9F]R
M;5]S<&5E9%]R871I;F< /2!A=&]I*'!R;V9O<FU?<W!E961?<F%T:6YG*3L-
M"B` ("` ("` ('!R;U]D871A+G5S97)?<F%T:6YG7S, ("` ("` (#T 871O
M:2AU<V5R7W)A=&EN9U\S*3L-"B` ("` ("` ('!R;U]D871A+G!R;V9O<FU?
M9F]R;5]R871I;F< (#T 871O:2AP<F]F;W)M7V9O<FU?<F%T:6YG*3L-"B` 
M("` ("` ('!R;U]D871A+G1I<U]P<F8 ("` ("` ("` ("` (#T 871O:2AT
M:7-?<')F*3L-"B` ("` ("` ('!R;U]D871A+FAI9VAE<W1?<F%T:6YG("` 
M("` (#T

M("` ("` ("!P<F]?9&%T82YA=F5?<F%T:6YG7V%L;"` ("` ("`](&%T;VDH
M879E7W)A=&EN9U]A;&PI.PT*("` ("` ("` <')O7V1A=&$N879E7W)A=&EN
M9U]T:')E92` ("` /2!A=&]I*&%V95]R871I;F=?=&AR964I.PT*("` ("` 
M("` <')O7V1A=&$N;65D:6%N7W)A=&EN9R` ("` ("` /2!A=&]I*&UE9&EA
M;E]R871I;F<I.PT*("` ("` ("` <')O7V1A=&$N;65D:6%N7W)A=&EN9U]T
M:')E92` /2!A=&]I*&UE9&EA;E]R871I;F=?=&AR964I.PT*("` ("` ("` 
M<')O7V1A=&$N<V5C;VYD7VAI9VAE<W1?<F%T:6YG(#T 871O:2AS96-O;F1?
M:&EG:&5S=%]R871I;F<I.PT*("` ("` ("` <')O7V1A=&$N<&]U;F1S7VQT
M;R` ("` ("` ("` /2!A=&]I*'!O=6YD<U]L=&\I.PT*("` ("` ("` <')O
M7V1A=&$N<G5N<U]B969O<F4 ("` ("` ("` /2!A=&]I*')U;G-?8F5F;W)E
M*3L-"B` ("` ("` ('!R;U]D871A+G=O;E]B969O<F4 ("` ("` ("` (#T 
M871O:2AW;VY?8F5F;W)E*3L-"B` ("` ("` ('!R;U]D871A+G!L8U]B969O
M<F4 ("` ("` ("` (#T 871O:2AP;&-?8F5F;W)E*3L-"B` ("` ("` ('!R
M;U]D871A+F9A=B` ("` ("` ("` ("` ("` (#T 871O:2AF878I.PT*("` 
M("` ("` <')O7V1A=&$N<V]R=%]S<%]O<F1E<B` ("` ("` ("` ("` (#T 
M,#L-"B` ("` ("` ('!R;U]D871A+G-O<G1?=V5I9VAT("` ("` ("` ("` 

M("` ("` ("` ("` /2`P.PT*("` ("` ("` <')O7V1A=&$N<V]R=%]E<5]T
M:7-S=64 ("` ("` ("` ("` (#T ,#L-"B` ("` ("` ('!R;U]D871A+G-O

M9&%T82YS;W)T7W!R;V9O<FU?9F]R;5]R871I;F< ("` /2`P.PT*("` ("` 
M("` <')O7V1A=&$N<V]R=%]P<F]F;W)M7W1I<W-U92` ("` ("` (#T ,#L-
M"B` ("` ("` ('!R;U]D871A+G-O<G1?<')O9F]R;5]T:7-?<')F("` ("` 

M("` ("` ("` /2`P.PT*("` ("` ("` <')O7V1A=&$N<V]R=%]P<F]F;W)M
M7VAI9VAE<W1?8VQA<W, (#T ,#L-"B` ("` ("` ('!R;U]D871A+G-O<G1?

M82YS;W)T7W!R;V9O<FU?879E7W)A=&EN9R` ("` /2`P.PT*("` ("` ("` 
M<')O7V1A=&$N<V]R=%]S96-O;F1?:&EG:&5S=%]R871I;F< (#T ,#L-"B` 
M("` ("` ('!R;U]D871A+G-O<G1?=F1W("` ("` ("` ("` ("` ("` ("`]


M(&EN=&\ <W1R=6-T*B\-"B` ("` ("` ('!R;U]D871A+G!R:7IE("` ("` 
M("` ("` ("` (#T

M("!P<F]?9&%T82YE>&%C=&$ ("` ("` ("` ("` ("`](&%T;V8H97AA8W1A
M*3L-"B` ("` ("` ('!R;U]D871A+F-S9B` ("` ("` ("` ("` ("` (#T 
M871O9BAC<V8I.PT*("` ("` ("` <')O7V1A=&$N;V1D<U]V86QU92` ("` 
M("` ("` /2!A=&]F*&]D9'-?=F%L=64I.PT*("` ("` ("` <')O7V1A=&$N
M=&ES<W5E7V]D9'-?=F%L=64 ("` /2!A=&]F*'1I<W-U95]O9&1S7W9A;'5E
M*3L-"B` ("` ("` ('!R;U]D871A+F9I;FES:&5D7W)A8V5S7W-R("` (#T 


M("` ("` ("!P<F]?9&%T82YP;&-?<W)?8F5F;W)E("` ("` ("`](&%T;V8H




M("` ("!P<F]?9&%T82YV86QU95]L=&\ ("` ("` ("` ("`](&%T;V8H=F%L
M=65?;'1O*3L-"B` ("` ("` ('!R;U]D871A+G!R;V9I=%]L;W-S("` ("` 
M("` (#T
M:7-T7W1O7VYE>'0 ("` ("` ("`](&%T;V8H9&ES=%]T;U]N97AT*3L-"B` 
M("` ("` ('!R;U]D871A+F1I<W1?=&]?=VEN;F5R("` ("` (#T 871O9BAD

M("` ("` ("` ("`](&%T;V8H=F1W*3L-"B` ("` ("` ('!R;U]D871A+F-A
M;&-?,2` ("` ("` ("` ("` (#T ,#L-"B` ("` ("` ('!R;U]D871A+F-A
M;&-?,B` ("` ("` ("` ("` (#T ,#L-"B` ("` ("` ('!R;U]D871A+F-A
M;&-?,R` ("` ("` ("` ("` (#T ,#L-"B` ("` ("` ('!R;U]D871A+F-A
M;&-?-"` ("` ("` ("` ("` (#T ,#L-"B` ("` ("` ('!R;U]D871A+F-A
M;&-?-2` ("` ("` ("` ("` (#T ,#L-"B` ("` ("` ('!R;U]D871A+F-A
M;&-?-B` ("` ("` ("` ("` (#T ,#L-"B` ("` ("` ('!R;U]D871A+F-A
M;&-?-R` ("` ("` ("` ("` (#T ,#L-"B` ("` ("` ('!R;U]D871A+F-A
M;&-?."` ("` ("` ("` ("` (#T ,#L-"B` ("` ("` ('!R;U]D871A+F-A
M;&-?.2` ("` ("` ("` ("` (#T ,#L-"B` ("` ("` ('!R;U]D871A+F-A
M;&-?,3` ("` ("` ("` ("` (#T ,#L-
M<V5R="!C:&%R<R!I;G1O('-T<G5C="` *B\-"B` ("` ("` ('-T<F-P>2AP
M<F]?9&%T82YD871E7W1I;64L9&%T95]T:6UE*3L-"B` ("` ("` ('-T<F-P
M>2AP<F]?9&%T82YC;W5R<V4L8V]U<G-E*3L-"B` ("` ("` ('-T<F-P>2AP
M<F]?9&%T82YC;W5R<V5?9&ER96-T:6]N+&-O=7)S95]D:7)E8W1I;VXI.PT*
M("` ("` ("` <W1R8W!Y*'!R;U]D871A+F-O=7)S95]C:&%R86-T97)I<W1I


M<'DH<')O7V1A=&$N<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S<ULR73L-"B` ("!I;G0 ("!N97=?8VQA<W-?;G5M.PT*("` (&EN

M86YD:6-A<%]L:6UI=#L-"B` ("!F;&]A="!T<FEC87-T.PT*("` (&9L;V%T

M.PT*("` (&-H87( (&]F9FEC:6%L7V=O:6YG6S(P73L-"B` ("!C:&%R("!C
M;&%S<VEF:6-A=&EO;G-;,S!=.PT*("` (&-H87( (&1A=&5;,3%=.PT*("` 
M(&-H87( (')A8V5?=&EM95LV73L-"B` ("!I;G0 ("!R86-E8V%R9%]N=6T[

M87( (&AO<G-E6S,P73L-"B` ("!C:&%R("!H;W)S95]C;W5N=')Y6S$P73L-
M"B` ("!C:&%R("!J;V-K97E;,C!=.PT*("` (&EN="` (&IO8VME>5]C;&%I
M;3L-"B` ("!C:&%R("!T<F%I;F5R6S,P73L-"B` ("!I;G0 ("!T:7-S=65?
M<F%T:6YG.PT*("` (&-H87( (&]D9'-?=&5X=%LV73L-"B` ("!F;&]A="!O
M9&1S7W9A;'5E.PT*("` (&EN="` (&%G93L-"B` ("!I;G0 ("!W96EG:'0[



M("` 9FQO870 9&ES=%]T;U]N97AT.PT*("` (&9L;V%T(&1I<W1?=&]?=VEN
M;F5R.PT*("` (&9L;V%T(&5Q7W)A=&EN9SL-"B` ("!F;&]A="!E<5]T:7-S

M=65?;V1D<U]T97AT6S9=.PT*("` (&9L;V%T('1I<W-U95]O9&1S7W9A;'5E

M=&ES7W!R9CL-"B` ("!I;G0 ("!H:6=H97-T7W)A=&EN9SL-"B` ("!I;G0 
M("!L=&]?<F%T:6YG.PT*("` (&EN="` (&%V95]R871I;F=?86QL.PT*("` 

M=&EN9SL-"B` ("!I;G0 ("!M961I86Y?<F%T:6YG7W1H<F5E.PT*("` (&EN



M73L-"B` ("!C:&%R("!D:7-T86YC95]L=&];,3%=.PT*("` (&9L;V%T('9A
M;'5E7VQT;SL-"B` ("!I;G0 ("!P;W5N9'-?;'1O.PT*("` (&9L;V%T(&9I
M;FES:&5D7W)A8V5S7W-R.PT*("` (&EN="` (')U;G-?8F5F;W)E.PT*("` 

M"B` ("!F;&]A="!P<F]F:71?;&]S<SL-"B` ("!I;G0 ("!P;&-?8F5F;W)E


M("` <V]R=%]S<%]O<F1E<CL-"B` ("!I;G0 ("!S;W)T7W=E:6=H=#L-"B` 
M("!I;G0 ("!S;W)T7W!R;V9O<FU?<W!E961?<F%T:6YG.PT*("` (&EN="` 
M('-O<G1?<')O9F]R;5]F;W)M7W)A=&EN9SL-"B` ("!I;G0 ("!S;W)T7W!R
M;V9O<FU?=&ES<W5E.PT*("` (&EN="` ('-O<G1?<')O9F]R;5]T:7-?<')F

M<V]R=%]P<F]F;W)M7VAI9VAE<W1?8VQA<W,[("`O*B!N;W0 =7-E9"!A="!P
M<F5S96YT(&%S(')E9F5R<R!T;R!C;&%S<R!B>2!L971T97( :64L($$L($(L
M(&5T8RX *B\-"B` ("!I;G0 ("!S;W)T7W!R;V9O<FU?:&EG:&5S=%]R871I




M("` (&9L;V%T(&-A;&-?-#L-
M870 8V%L8U\V.PT*("` (&9L;V%T(&-A;&-?-SL-"B` ("!F;&]A="!C86QC


M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM

M93H ("!/<&5N<R!F:6QE(&%C8V]R9&EN9R!T;R!A<F=U;65N=', <&%S<V5D

M("!&24Q%('!T< T*("TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM


M;W!E;BAF;F%M92P ;6]D92D *2`]/2!.54Q,*0T*("` >PT*("` ("` <')I
M;G1F*")<;D5R<F]R(&]P96YI;F< )7, +BXN17AI=&EN9R(L(&9N86UE*3L-

`
end
Apr 09 2007
parent 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