[Spice-devel] [spice-html5] Tweak hexdump to not generate new lines.

Uri Lublin uril at redhat.com
Wed May 21 02:10:16 PDT 2014


On 05/20/2014 09:03 PM, Jeremy White wrote:
> Signed-off-by: Jeremy White <jwhite at codeweavers.com>
> ---
>   utils.js |    5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/utils.js b/utils.js
> index 167f184..9eb42ff 100644
> --- a/utils.js
> +++ b/utils.js
> @@ -63,7 +63,10 @@ function hexdump_buffer(a)
>               hex += "0";
>           hex += h + " ";
>   
> -        str += String.fromCharCode(mg[i]);
> +        if (mg[i] == 10 || mg[i] == 13 || mg[i] == 8)
> +            str += ".";
> +        else
> +            str += String.fromCharCode(mg[i]);
>   
>           if ((i % 16 == 15) || (i == (mg.length - 1)))
>           {

Hi,

Looks good but maybe it's better to use isprint

Uri.


More information about the Spice-devel mailing list