Skip to content

Commit

Permalink
Fixed ipp-usb status formatting for small port numbers (<10000)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpevzner committed Nov 7, 2024
1 parent 4dd7f87 commit 2e3d63c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions status.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,17 @@ func StatusFormat() []byte {
for i, status := range devs {
info, _ := status.desc.GetUsbDeviceInfo()

fmt.Fprintf(buf, " %3d. %s %4.4x:%.4x %d %q\n",
fmt.Fprintf(buf, " %3d. %s %4.4x:%.4x %-5d %q\n",
i+1, status.desc.UsbAddr,
info.Vendor, info.Product, status.HTTPPort, info.MfgAndProduct)
info.Vendor, info.Product, status.HTTPPort,
info.MfgAndProduct)

s := "OK"
if status.init != nil {
s = devs[i].init.Error()
}

fmt.Fprintf(buf, " status: %s\n", s)
fmt.Fprintf(buf, " status: %s\n", s)
}
}

Expand Down

1 comment on commit 2e3d63c

@arnowillig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

Please sign in to comment.