From 588514a6f92cdde6ae5835f169138afe551255fb Mon Sep 17 00:00:00 2001 From: ehouse Date: Fri, 14 Apr 2006 08:23:28 +0000 Subject: [PATCH] exit if can't open table file; include assert for compile on sarge --- dawg/dict2dawg.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dawg/dict2dawg.cpp b/dawg/dict2dawg.cpp index fe80c3e3f..c89b651b5 100644 --- a/dawg/dict2dawg.cpp +++ b/dawg/dict2dawg.cpp @@ -1,4 +1,4 @@ -/* -*- compile-command: "g++ -g -o dict2dawg dict2dawg.cpp"; -*- */ +/* -*- compile-command: "g++ -O -o dict2dawg dict2dawg.cpp"; -*- */ /************************************************************************* * adapted from perl code that was itself adapted from C++ code * Copyright (C) 2000 Falk Hueffner @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -750,6 +751,9 @@ makeTableHash( void ) { int i; FILE* TABLEFILE = fopen( gTableFile, "r" ); + if ( NULL == TABLEFILE ) { + ERROR_EXIT( "unable to open %s\n", gTableFile ); + } for ( i = 0; ; ++i ) { int ch = getc(TABLEFILE);