# HG changeset patch # User Erik Quanstrom # Date 1317131036 -7200 # Node ID 88e74744e7480ce8c17170928123b5044e916dca # Parent 1f565f3fedf3f9a02b6a8f7c968b2fc17cbede2d /sys/src/nix/386/pci.c: %T don't crash if the bustype is BUSUNKNOWN such as for io port-based devices. R=nix-dev, nemo CC=nix-dev http://codereview.appspot.com/5129050 Committer: Francisco J Ballesteros diff -r 1f565f3fedf3 -r 88e74744e748 sys/src/nix/386/pci.c --- a/sys/src/nix/386/pci.c Mon Sep 26 16:51:42 2011 -0700 +++ b/sys/src/nix/386/pci.c Tue Sep 27 15:43:56 2011 +0200 @@ -96,14 +96,15 @@ tbdffmt(Fmt* fmt) { char *p; - int l, r, type, tbdf; + int l, r; + uint type, tbdf; if((p = malloc(READSTR)) == nil) return fmtstrcpy(fmt, "(tbdfconv)"); switch(fmt->r){ case 'T': - tbdf = va_arg(fmt->args, int); + tbdf = va_arg(fmt->args, uint); type = BUSTYPE(tbdf); if(type < nelem(bustypes)) l = snprint(p, READSTR, bustypes[type]);