diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2017-04-28 22:16:44 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2017-04-28 22:16:44 +0000 |
commit | 0efd2df514b59e904db74b5c86d95b4de261fda2 (patch) | |
tree | c2e828c86f83d31b174466005daf453cfb3bf2ec /bin/stty | |
parent | ed30a2d090fe706be55366ee5b392e9f2cf7e9d7 (diff) |
Quiet a clang warning from -Wstring-plus-int. OK naddy@
Diffstat (limited to 'bin/stty')
-rw-r--r-- | bin/stty/print.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/bin/stty/print.c b/bin/stty/print.c index cd291016d14..ca58c2f71f5 100644 --- a/bin/stty/print.c +++ b/bin/stty/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.15 2016/11/26 11:18:43 mpi Exp $ */ +/* $OpenBSD: print.c,v 1.16 2017/04/28 22:16:43 millert Exp $ */ /* $NetBSD: print.c,v 1.11 1996/05/07 18:20:10 jtc Exp $ */ /*- @@ -41,7 +41,7 @@ #include "extern.h" static void binit(char *); -static void bput(char *); +static void bput(const char *, unsigned int); static char *ccval(const struct cchar *, int); void @@ -86,7 +86,7 @@ print(struct termios *tp, struct winsize *wp, int ldisc, enum FMT fmt) #define on(f) ((tmp&f) != 0) #define put(n, f, d) \ if (fmt >= BSD || on(f) != d) \ - bput(n + on(f)); + bput(n, on(f)); /* "local" flags */ tmp = tp->c_lflag; @@ -146,19 +146,19 @@ print(struct termios *tp, struct winsize *wp, int ldisc, enum FMT fmt) put("-cread", CREAD, 1); switch(tmp&CSIZE) { case CS5: - bput("cs5"); + bput("cs5", 0); break; case CS6: - bput("cs6"); + bput("cs6", 0); break; case CS7: - bput("cs7"); + bput("cs7", 0); break; case CS8: - bput("cs8"); + bput("cs8", 0); break; } - bput("-parenb" + on(PARENB)); + bput("-parenb", on(PARENB)); put("-parodd", PARODD, 0); put("-hupcl", HUPCL, 1); put("-clocal", CLOCAL, 0); @@ -173,7 +173,7 @@ print(struct termios *tp, struct winsize *wp, int ldisc, enum FMT fmt) for (p = cchars1; p->name; ++p) { (void)snprintf(buf1, sizeof(buf1), "%s = %s;", p->name, ccval(p, cc[p->sub])); - bput(buf1); + bput(buf1, 0); } binit(NULL); } else { @@ -214,8 +214,9 @@ binit(char *lb) } static void -bput(char *s) +bput(const char *s, unsigned int off) { + s += off; if (col == 0) { col = printf("%s: %s", label, s); |