]> sourceware.org Git - systemtap.git/commitdiff
string.stp: fix str_replace() return
authorJonathan Lebon <jlebon@redhat.com>
Wed, 22 Jan 2014 14:01:57 +0000 (09:01 -0500)
committerJonathan Lebon <jlebon@redhat.com>
Wed, 22 Jan 2014 18:57:08 +0000 (13:57 -0500)
Unfortunately, we can't use STAP_RETURN() here because we've been
gradually building STAP_RETVALUE from multiple concatenations so using
STAP_RETURN() would overwrite the hard work.

tapset/string.stp

index e27f055d8bb8807800314bc4407673486e172ff4..4d0e2f7e20a60da617cda9180e24eca4557e3f05 100644 (file)
@@ -140,7 +140,8 @@ function str_replace:string (prnt_str:string, srch_str:string, rplc_str:string)
                ptr_base = ptr;
        }
 
-       STAP_RETURN (ptr_base);
+       strlcat(STAP_RETVALUE, ptr_base, MAXSTRINGLEN);
+       return;
 %}
 
 /**
This page took 0.029673 seconds and 5 git commands to generate.