From: Brian Paul Date: Wed, 29 Mar 2000 17:56:02 +0000 (+0000) Subject: added error checking on file open X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a564056f59d3ee9b0ff20c45fbe5234a47d5149;p=mesa.git added error checking on file open --- diff --git a/progs/demos/geartrain.c b/progs/demos/geartrain.c index 91c3411d7c9..7c42aeb3d52 100644 --- a/progs/demos/geartrain.c +++ b/progs/demos/geartrain.c @@ -1,4 +1,4 @@ -/* $Id: geartrain.c,v 1.2 2000/03/22 23:14:54 brianp Exp $ */ +/* $Id: geartrain.c,v 1.3 2000/03/29 17:56:02 brianp Exp $ */ /* * Geartrain simulation @@ -145,6 +145,11 @@ getdata (char filename[]) int gear_count = 0, axle_count = 0, belt_count = 0, i; mainfile = fopen (filename, "r"); + if (!mainfile) { + printf("Error: couldn't open %s\n", filename); + exit(-1); + } + do { Clear_Buffers ();