projects
/
selector.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8c08e0c
)
Increased the buffer size and added an error when a line too long is met.
author
Francois Fleuret
<francois@fleuret.org>
Sat, 28 Mar 2009 22:21:58 +0000
(23:21 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Sat, 28 Mar 2009 22:21:58 +0000
(23:21 +0100)
selector.cc
patch
|
blob
|
history
diff --git
a/selector.cc
b/selector.cc
index
9c669f7
..
f5b9d2d
100644
(file)
--- a/
selector.cc
+++ b/
selector.cc
@@
-41,7
+41,7
@@
using namespace std;
#define VERSION "1.0"
-const int buffer_size =
1024
;
+const int buffer_size =
4096
;
// Yeah, global variables!
@@
-544,6
+544,12
@@
int main(int argc, char **argv) {
file.getline(raw_line, buffer_size);
+ if(file.fail()) {
+ cerr << "Line too long." << endl;
+ cerr << raw_line << endl;
+ exit(1);
+ }
+
if(raw_line[0]) {
char *s, *t;