From: "Santosh H." Newsgroups: comp.os.msdos.djgpp Subject: printf & scanf behave shadily???Pls discuss Date: Thu, 16 Sep 1999 07:57:01 +0530 Organization: VSNL Lines: 38 Message-ID: NNTP-Posting-Host: giasbga.vsnl.net.in Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: news.vsnl.net.in 937486601 9874 202.54.12.161 (16 Sep 1999 12:56:41 GMT) X-Complaints-To: postmaster AT news DOT vsnl DOT net DOT in NNTP-Posting-Date: 16 Sep 1999 12:56:41 GMT X-Sender: hsantosh AT giasbga To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi all, I think u chaps must've seen my posting about rep stosb causing a gpf(General protection fault) at that very instruction every time.Well I sorta think I found a bug in libc.In my C program that was calling the asm procedures had 2 lines like this printf("Enter which gmode: "); scanf("%d",&mode); followed by- InitMode(); InitGraphics(); Drawline(); <- just a test proc that uses rep stosb for drawing when those two printf & scanf are there the instruction sub edi,edi or any other instruction using ei seems to go ignored & edi ends up with a value of 000010000 when the linit of the segment is 000000ffff obviously causing a gpf.The code runs fine when i add a mode = 0x0013 and comment out the printf & scanf ??? So what's the problem here?Is it a bug in DJGPP or libc or what. Have any of u run into the same problems before.? Mind if this's got something thing to do with an incompatibiity problem between mode 13h & printf/scanf I'm doing the mode sets after I call printf & scanf to' I don't see how it is posible. Pls therefore gurus enlighten me on this aspect. Santosh ****************************************************************** Santosh .H : Activities Linux Linux and only Linux :-) Thought for a lifetime: Only Wimps use MS windows Toughs use Linux:-) ******************************************************************