]> git.lizzy.rs Git - plan9front.git/commitdiff
acid: use correct print flags and casts for shorts in fmt
authormischief <mischief@offblast.org>
Sat, 1 Feb 2014 20:14:30 +0000 (12:14 -0800)
committermischief <mischief@offblast.org>
Sat, 1 Feb 2014 20:14:30 +0000 (12:14 -0800)
sys/src/cmd/acid/builtin.c

index 039c6528d5690c54128d49a6aaeedb5628bd6188..0ebc11bbf3b23123d516352a335e06f97137574e 100644 (file)
@@ -1009,10 +1009,10 @@ patom(char type, Store *res)
                Bprint(bout, "%d", (int)res->ival);
                break;
        case 'd':
-               Bprint(bout, "%d", (ushort)res->ival);
+               Bprint(bout, "%hd", (short)res->ival);
                break;
        case 'u':
-               Bprint(bout, "%d", (int)res->ival&0xffff);
+               Bprint(bout, "%hud", (ushort)res->ival);
                break;
        case 'U':
                Bprint(bout, "%lud", (ulong)res->ival);