From: "JCx" Newsgroups: comp.os.msdos.djgpp Subject: Problem writing in a file... Date: Wed, 20 May 1998 20:16:21 +0200 Lines: 49 Message-ID: <6jv6lo$73e$1@news3.isdnet.net> NNTP-Posting-Host: p15-199.province.worldnet.fr To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi there ! I just spent two hours trying to code -without success- the following thing: I open a text file, then look for a specific string in this file (with fgets) and then, when I find this string, my program is supposed to add another string just after the one it found (with fprintf). The problem is: the program duplicates everything that stands after the line found, and then adds the line I looked for+the line I wanted to add at the end of the file ! To say it clearly: It opens system.ini : working It looks for [drivers32] : working I *should* write a string just after this line : bug Could anyone help me ? Source included. Thanks, JCx. jicehix AT worldnet DOT fr begin 666 addv.c M+RH AT 861D=BYC("HO#0H-"B-I;F-L=61E(#QS=&1I;RYH/@T*(VEN8VQU9&4@ M/'-T9&QI8BYH/@T*#0I&24Q%("IF:6-H:65R.PT*8VAAPT*(" @(" @<')I;G1F*")<;D9I;&4@;F]T(&9O=6YD(#HH M7&XB*3L-"B @(" @(&5X:70H,2D[#0H@("!]#0H@("!P'1E+#$R+&9I8VAI97(I.PT*(" @(" @:68@*'1E>'1E6S!= M/3TG6R'1E6S%=/3TG9"'1E6S-=/3TG:2'1E6S1=/3TG=B'1E6S9=/3TG M'1E6S==/3TG'1E6SE=/3TG,B'1E6S$P M73TG72PT*(" @(" @(" @(" @(" @(" @ M(&9P