www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/25/18:09:08

From: "Paul Vanukoff" <vanukoff AT primenet DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: GPF when reading or writing files larger than a certain size
Date: Fri, 25 Aug 2000 11:08:22 -0700
Organization: Frontier GlobalCenter Inc.
Lines: 53
Message-ID: <8o6cms$iph$1@nnrp02.primenet.com>
NNTP-Posting-Host: unknown-206-phx.globalcrossing.com
X-Complaints-To: abuse AT globalcenter DOT net
X-Posted-By: @206.165.0.206 (vanukoff)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi all,

I have two routines, one saves a binary buffer, the other loads.

If I am in RHIDE, and run the program, I get a GPF if "length" is more than
49151.

If I am in DOS, and run the program, I get a GPF if "length" is more than
16383;

Here are the routines:

// begin //

void buffersave(char* filename, unsigned char* buffer, int length)
{
    int bc;
    FILE* fp = fopen(filename, "wb");

    for(bc=0;bc<length;bc++)
    {
        fputc(buffer[bc], fp);
    }

    fclose(fp);
}

void bufferload(char* filename, unsigned char* buffer, int length)
{
    int bc;
    FILE* fp = fopen(filename, "rb");

    for(bc=0;bc<length;bc++)
    {
        buffer[bc] = fgetc(fp);
    }

    fclose(fp);
}

// end //

I am running under Win98/DOS boxes.

I'm sure there is a simple solution. Any ideas?


--
Paul Vanukoff



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019