diff options
author | Brian Paul <[email protected]> | 2000-03-29 17:56:02 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2000-03-29 17:56:02 +0000 |
commit | 5a564056f59d3ee9b0ff20c45fbe5234a47d5149 (patch) | |
tree | eae18d8995d1bea83bb1ac5cbbfcfa0743634673 | |
parent | 070b2644c6d3b0b4c6da64addd85245d730b6240 (diff) |
added error checking on file open
-rw-r--r-- | progs/demos/geartrain.c | 7 |
1 files changed, 6 insertions, 1 deletions
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 (); |