Hi,

Before this patch, -s N shows N+1 chars in strings.
More annoyingly, it shows this for shorter strings:

write(1, "hi\n"..., 3) = 3

After patch:

write(1, "hi\n", 3) = 3

Patch author is Jeff Bastian [EMAIL PROTECTED]

Patch is below. Please apply.
--
vda

--- strace-4.5.18.ORIG/util.c   2008-10-20 18:26:25.000000000 -0400
+++ strace-4.5.18/util.c        2008-10-20 18:33:01.000000000 -0400
@@ -556,14 +556,14 @@ printstr(struct tcb *tcp, long addr, int
                }
        }
        else {
-               size = MIN(len, max_strlen + 1);
+               size = MIN(len, max_strlen);
                if (umoven(tcp, addr, size, str) < 0) {
                        tprintf("%#lx", addr);
                        return;
                }
        }
 
-       if (string_quote(str, outstr, len, size))
+       if (string_quote(str, outstr, len, size) && (len > max_strlen))
                strcat(outstr, "...");
 
        tprintf("%s", outstr);



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to