diff options
author | Matt Johnston <matt@ucc.asn.au> | 2004-09-02 18:36:11 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2004-09-02 18:36:11 +0000 |
commit | cce7f0409cfb7a688b68a3e92fcf7c06c700c385 (patch) | |
tree | 7ea4f929a108f1c0e177de903199553df11b96f9 | |
parent | a5c4f090d29bc569b7f49d11dbf217a29bcf4b3a (diff) | |
download | dropbear-cce7f0409cfb7a688b68a3e92fcf7c06c700c385.tar.gz |
Read the last line of a file without a finishing '\n' correctly
-rw-r--r-- | dbutil.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -506,18 +506,17 @@ int buf_getline(buffer * line, FILE * authfile) { out: - buf_setpos(line, 0); /* if we didn't read anything before EOF or error, exit */ if (c == EOF && line->pos == 0) { - TRACE(("leave getauthline: failure")); + TRACE(("leave buf_getline: failure")); return DROPBEAR_FAILURE; } else { - TRACE(("leave getauthline: success")); + TRACE(("leave buf_getline: success")); + buf_setpos(line, 0); return DROPBEAR_SUCCESS; } - TRACE(("leave buf_getline")); } #endif |