Re: [spice-html5] Tweak hexdump to not generate new lines.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/20/2014 09:03 PM, Jeremy White wrote:
Signed-off-by: Jeremy White <jwhite@xxxxxxxxxxxxxxx>
---
  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.
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]