Date: Sat, 27 Apr 1996 10:00:27 -0700 (PDT) From: Jag To: Samuel Vincent cc: Eli Zaretskii , djgpp AT delorie DOT com Subject: Re: problem with DJGPP and arrays. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII > [error message and code examples removed] > > Hrm.. it sounds as if you are accessing memory with a garbage pointer.. > in other words, going outside your array... And somehow declaring more > array storage gives more memory so you happen to hit memory which was > allocated somewhere (probably not for that particular piece of code that > is accessing it however...) > > Could you post the contents of function read_t2? > void fread_t2(char p_a, char *s_a, int l_c) /* read x amount of bytes */ { /* start_addr, string, count */ int handle, l_a; handle = _open( s_a, 0); if (handle != -1) { l_a = _read(handle, p_a, l_c); _close(handle); if (l_a == 0) { /* !@#$ add out, error and stop code */ out(); printf("Error reading file...\n"); } else if (l_c != l_a) { out(); printf("File size error...\n"); } } else { /* add out, error and stop code */ out(); printf("Error opening file...\n"); } }