From 29ee2d0462c4ad10cde3d2d7f53b2b6a7f4ac789 Mon Sep 17 00:00:00 2001
From: Robert Ricci <ricci@cs.utah.edu>
Date: Thu, 12 Aug 2004 23:00:22 +0000
Subject: [PATCH] Bump up the maximum line size for lines in the ptop file, and
 make errors in the ptop file immediately fatal - we were somehow getting into
 a state where the istream for the file was returning !eof, but reading data
 from it got only empty strings.

---
 assign/parse_ptop.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/assign/parse_ptop.cc b/assign/parse_ptop.cc
index 2508d6557d..85b05752fd 100644
--- a/assign/parse_ptop.cc
+++ b/assign/parse_ptop.cc
@@ -19,7 +19,7 @@ using namespace boost;
 extern name_pvertex_map pname2vertex;
 extern name_count_map ptypes;
 
-#define ptop_error(s) errors++;cout << "PTOP:" << line << ": " << s << endl
+#define ptop_error(s) errors++;cout << "PTOP:" << line << ": " << s << endl; exit(EXIT_FATAL)
 #define ptop_error_noline(s) errors++;cout << "PTOP: " << s << endl
 
 // Used to do late binding of subnode names to pnodes, so that we're no
@@ -54,12 +54,12 @@ int parse_ptop(tb_pgraph &PG, tb_sgraph &SG, istream& i)
 {
   int num_nodes = 0;
   int line=0,errors=0;
-  char inbuf[4096];
+  char inbuf[16384];
   string_vector parsed_line;
 
   while (!i.eof()) {
     line++;
-    i.getline(inbuf,4096);
+    i.getline(inbuf,16384);
     parsed_line = split_line(inbuf,' ');
     if (parsed_line.size() == 0) {continue;}
 
-- 
GitLab