Browse Source
The swolisten program failed to print the cbw buffer correctly while in dump mode. As printf() is used to print the dump, it is expected that the cbw buffer is zero-terminated, which would only be the case, if the cbw buffer is initialized with zeros, before filling it with new data. One could set the entire cbw buffer to zero, but it will be more efficient to only set the size-th byte to zero. Furthermore, if a '%' character appears in the data, printf() will attempt to format it, causing unexpected results. This patch fixes the above 2 problems, by: 1. using the size variable to set the size-th byte of the cbw buffer to zero, before passing it to printf(). 2. calling printf() with a "%s" formatting string, followed by the data buffer, cbw.pull/645/head
Pieter du Preez
5 years ago
committed by
UweBonnes
1 changed files with 4 additions and 1 deletions
Loading…
Reference in new issue