[brlcad-commits] SF.net SVN: brlcad:[48693] brlcad/trunk/src/gtools/remapid.c
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <n_...@us...> - 2012-01-13 15:36:36
|
Revision: 48693 http://brlcad.svn.sourceforge.net/brlcad/?rev=48693&view=rev Author: n_reed Date: 2012-01-13 15:36:25 +0000 (Fri, 13 Jan 2012) Log Message: ----------- unhandled EOF returns. CID 378, 379 Modified Paths: -------------- brlcad/trunk/src/gtools/remapid.c Modified: brlcad/trunk/src/gtools/remapid.c =================================================================== --- brlcad/trunk/src/gtools/remapid.c 2012-01-13 15:35:49 UTC (rev 48692) +++ brlcad/trunk/src/gtools/remapid.c 2012-01-13 15:36:25 UTC (rev 48693) @@ -585,6 +585,11 @@ return 1; case '-': *ch = remapid_fgetc(sfp); + if (*ch == EOF) { + remapid_file_err(sfp, "remapid:read_block()", "Unexpected EOF", + (int)((sfp->file_bp) - bu_vls_addr(&(sfp->file_buf)) - 1)); + return -1; + } if (read_int(sfp, ch, n2) != 1) return -1; else @@ -788,7 +793,8 @@ /* just copy the rest of the component */ while (coord_no < 3*vertex_count || !in_space) { ch = fgetc(fd_in); - if (ch == EOF && coord_no < 3*vertex_count) { + + if (ch == EOF) { bu_log("Unexpected EOF while processing ident %d\n", id); bu_exit(EXIT_FAILURE, "Unexpected EOF\n"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |