Xref: utzoo comp.os.msdos.programmer:762 comp.lang.c:31598 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!ydist From: ydist@unix.cis.pitt.edu (Yijun Ding) Newsgroups: comp.os.msdos.programmer,comp.lang.c Subject: TC bugs Keywords: bug, TC Message-ID: <35025@unix.cis.pitt.edu> Date: 5 Sep 90 01:59:20 GMT Organization: Univ. of Pittsburgh, Computing & Information Services Lines: 30 I recently got the patch files for TC 2.0 from simtel20. This cleard some entries from my TC-bug-list. The following program demonstrates other two possible bugs. The first is definitely a bug. When compiled on unix system, it print 3.14e... instead of 3.1e... The second, I am not sure. The "a+" format does not allow write to the beginning of files in TC. On unix, the printout is "isis is a ..." instead of "This is a..." on TC. Any comments? #include #include FILE *fi; char buf[]="This is a test.\n"; main() { /* e-format precision incorrect */ printf("%5.2e\n", 3.141596); /* a+ can't write over */ fi = fopen("tmp.doc", "a+"); fwrite(buf, sizeof(buf), 1, fi); fseek(fi, 0L, 0); fwrite(buf+2, 2, 1, fi); fseek(fi, 0L, 0); fread(buf, sizeof(buf), 1, fi); printf(buf); getchar(); }