chiark / gitweb /
SECURITY: adnshost: Fix missing-final-newline handling on stdin read
[adns.git] / client / adh-main.c
index 17d02d8d7ef0a2bec434341be319bd3fda2e701d..31335b70dd11cb22b09691aa89c8f58d8a11e805 100644 (file)
@@ -5,7 +5,8 @@
  */
 /*
  *  This file is part of adns, which is
- *    Copyright (C) 1997-2000,2003,2006  Ian Jackson
+ *    Copyright (C) 1997-2000,2003,2006,2014-2016  Ian Jackson
+ *    Copyright (C) 2014  Mark Wooding
  *    Copyright (C) 1999-2000,2003,2006  Tony Finch
  *    Copyright (C) 1991 Massachusetts Institute of Technology
  *  (See the file INSTALL for full details.)
@@ -205,7 +206,7 @@ static void read_stdin(void) {
       if (r == 0) {
        if (used) {
          /* fake up final newline */
-         buf[used++]= '\n';
+         buf[used]= '\n';
          r= 1;
        } else {
          ov_pipe= 0;