diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-11 23:05:36 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-11 23:05:36 +0000 |
commit | 30746a4e92469e8223e3646dea572190357b2db4 (patch) | |
tree | 0f84b7448722805bc25285989e3e64a723a89db3 /cmd-generic.c | |
parent | 9e56f538952f0e15485fc03fc21ebad5d926c05e (diff) |
Doh. Return the offset not the total.
Diffstat (limited to 'cmd-generic.c')
-rw-r--r-- | cmd-generic.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd-generic.c b/cmd-generic.c index f168d312..50b11599 100644 --- a/cmd-generic.c +++ b/cmd-generic.c @@ -1,4 +1,4 @@ -/* $Id: cmd-generic.c,v 1.17 2009-01-10 01:51:21 nicm Exp $ */ +/* $Id: cmd-generic.c,v 1.18 2009-01-11 23:05:36 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -63,6 +63,8 @@ cmd_do_flags(int opt, int iflags, int *oflags) size_t cmd_print_flags(char *buf, size_t len, size_t off, int flags) { + size_t boff = off; + if ((flags & (CMD_DFLAG|CMD_GFLAG|CMD_KFLAG|CMD_UFLAG)) == 0) return (0); off += xsnprintf(buf + off, len - off, " -"); @@ -74,7 +76,7 @@ cmd_print_flags(char *buf, size_t len, size_t off, int flags) off += xsnprintf(buf + off, len - off, "k"); if (off < len && flags & CMD_UFLAG) off += xsnprintf(buf + off, len - off, "u"); - return (off); + return (off - boff); } int |