🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #7003

MSC 6.00A bug?

#7003
From: Ang Cheng Chai
Date: Fri, 07 Jun 1991 13:08
48 lines
1596 bytes
Hi there,
    I think this is a bug in MSC 6.00A.
Program reads in data from file "inp.dat".
Each fscanf should read in the bits of data until it hits a comma.
The file ptr does not seem to be advancing.
I have included the input as well as the output.
This works fine with Turco C++ and MSC 5.1 but not MSC 6.00A.
I dont think I'm doing anything wrong.

/*--- The program */
#include <stdio.h>
#include <stdlib.h>

main(int ac, char *av[])
{
    FILE *fp = (FILE *) NULL;
    int ns = 0;
    char tmps[BUFSIZ], tmpc;

    if ((fp = fopen(av[1], "rt")) == (FILE *) NULL)
        abort();
    for (;;) {
	ns = fscanf(fp, "%[^,]%c", tmps, &tmpc);
	printf("Seen(%s)(%d)\n", tmps, ns);
    }
}

*---- inp.dat
Simple Super,,S,0,SS,10
Simple Super Plus,,P,0,RUNSSP,11

*--- This is the output
Seen(Simple Super)(2)
Seen(Simple Super)(0)
Seen(Simple Super)(0)
Seen(Simple Super)(0)
Seen(Simple Super)(0)
Seen(Simple Super)(0)
Seen(Simple Super)(0)


Many thanks in advance,
Chai.
-- 
ACSnet:	ang@latcs1.oz
ARPA:	ang%latcs1.oz@uunet.uu.net
UUCP : {hplabs,mcvax,ukc,nttlab}!uunet!munnari!latcs1.oz!ang
Technical Details
Message-ID: <1991Jun7.130821.9781@latcs1.lat.oz.au>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!munnari.oz.au!ariel!ucsvc.ucs.unimelb.edu.au!luga!latcs1!ang

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!munnari.oz.au!ariel!ucsvc.ucs.unimelb.edu.au!luga!latcs1!ang
From: ang@latcs1.lat.oz.au (Ang Cheng Chai)
Newsgroups: comp.os.msdos.programmer
Subject: MSC 6.00A bug?
Message-ID: <1991Jun7.130821.9781@latcs1.lat.oz.au>
Date: 7 Jun 91 13:08:21 GMT
Sender: ang@latcs1.lat.oz.au (Ang Cheng Chai)
Organization: Comp Sci, La Trobe Uni, Australia
Lines: 48