diff options
| author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-09-07 20:28:20 +0200 |
|---|---|---|
| committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-09-07 20:28:20 +0200 |
| commit | 15cc19e3d16f72b745a5d1ac362985e9839624d5 (patch) | |
| tree | 4f64aae431389426fa9f589dc83b51633720f506 /src | |
| parent | a804e1f5645ac75d196e0c9f1ac3b2524a42aac3 (diff) | |
exit on read error
Diffstat (limited to 'src')
| -rw-r--r-- | src/pnmcurvedit.cxx | 3 |
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])) { |
