summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-09-07 20:28:20 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-09-07 20:28:20 +0200
commit15cc19e3d16f72b745a5d1ac362985e9839624d5 (patch)
tree4f64aae431389426fa9f589dc83b51633720f506
parenta804e1f5645ac75d196e0c9f1ac3b2524a42aac3 (diff)
exit on read error
-rw-r--r--src/pnmcurvedit.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pnmcurvedit.cxx b/src/pnmcurvedit.cxx
index a9e9e5a..3dca6b6 100644
--- a/src/pnmcurvedit.cxx
+++ b/src/pnmcurvedit.cxx
@@ -35,7 +35,8 @@ static void
stdin_cb(int fd, void *d) {
char *curve = NULL;
- fgets(cmd, sizeof(cmd), stdin);
+ if (fgets(cmd, sizeof(cmd), stdin) == NULL)
+ exit(0);
for (int i = strlen(cmd) - 1; i >= 0; i--)
if (isspace(cmd[i])) {