]> sourceware.org Git - systemtap.git/commitdiff
Don't cast the pointer in STAP_RETVALUE:string
authorJosh Stone <jistone@redhat.com>
Mon, 6 Jan 2014 19:55:13 +0000 (11:55 -0800)
committerJosh Stone <jistone@redhat.com>
Mon, 6 Jan 2014 19:55:13 +0000 (11:55 -0800)
If the embedded C author uses the wrong pointer type, the compiler
should rightly complain about it when passed to strlcpy.  In the rare
case a cast is truly needed, it should be manually added.

translate.cxx

index 04e753ed31c062a958c4b2c2a38cd58a067a61bb..7ef4c86e0a17c71294470f180a221eb9b984ef18 100644 (file)
@@ -2128,7 +2128,7 @@ c_unparser::emit_function (functiondecl* v)
 
     case pe_string:
       o->newline() <<
-        "#define STAP_RETURN(v) do { strlcpy(STAP_RETVALUE, (const char*) (v), MAXSTRINGLEN); "
+        "#define STAP_RETURN(v) do { strlcpy(STAP_RETVALUE, (v), MAXSTRINGLEN); "
         "goto out; } while(0)";
       break;
 
This page took 0.06298 seconds and 5 git commands to generate.