www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/20/16:05:25

From: elf AT netcom DOT com (Marc Singer)
Subject: BUG in libc for v2.0?
To: djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP List Alias)
Date: Tue, 20 Jun 1995 12:13:17 -0700 (PDT)

If you execute this program after making a copy of the source in a
file called foozle, the expected result would be a seven character
file "foozle" containing the string "Yowza!".  This is the case for
Linux, but the libc for v2.0 of DJGPP neglects to clobber the target
file "foozle" before writing.

/*
   */

#include <stdio.h>
#include <stdlib.h>

void main (void)
{
  FILE* fp = fopen ("foozle", "w");
  fprintf (fp, "Yowza!\n");
  fclose (fp);

  exit (0);
} 

-- 
Marc Singer      |                              The desert has little water.
elf AT netcom DOT com   |                                The city has little time.

- Raw text -


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