diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-04-29 04:44:44 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-04-29 04:44:44 -0700 |
commit | 32d84fb2925e6f511fb8f8762ee02cb567095215 (patch) | |
tree | cd26d25802d043ecfff9b178b18d524d27fa43c6 | |
parent | 68429e4f41e0691acb37e73f35e42a5d12f5302c (diff) | |
download | pw-32d84fb2925e6f511fb8f8762ee02cb567095215.tar.gz pw-32d84fb2925e6f511fb8f8762ee02cb567095215.tar.bz2 pw-32d84fb2925e6f511fb8f8762ee02cb567095215.zip |
Fix shifting position and double showing of < truncation marker.
-rw-r--r-- | pw.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -248,12 +248,13 @@ static void drawline(const char *line, int hpos, int columns) line += hpos; len -= hpos; putchar('>'); + columns--; } - if (len < (size_t) columns - 1) { + if (len < (size_t) columns) { fputs(line, stdout); clreol(1); } else { - for (int i = 0; i < columns - 2; i++) + for (int i = 0; i < columns - 1; i++) putchar(line[i]); puts("<"); } |