sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit d1bbe5964103ab5b0fca85eda158ae6502869f88
parent 6c28007670d2beffe302acfa0a66ee656ae31da1
Author: FRIGN <dev@frign.de>
Date:   Wed Sep 30 20:06:22 +0200

Fix last offset output using skip in od(1)

Yeah, if the skipping is longer than the file itself, we need
to take the skip value, not the address.
Also, only print the last newline when we've actually printed
at least 1 address.

Diffstat:
od.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/od.c b/od.c @@ -89,10 +89,10 @@ od(FILE *in, char *in_name, FILE *out, char *out_name) if (feof(in) || ferror(in) || ferror(out)) break; } - if (addr) + if (addr - skip > 0) fputc('\n', out); if (radix != 'n') { - printaddress(out, addr); + printaddress(out, MAX(addr, skip)); fputc('\n', out); } }