Revision: 1031
Author: [email protected]
Date: Thu Jan 21 05:56:26 2010
Log: In incr_sub_inclusive_time(), copy a '\0' instead of explicitly
writing one.
http://code.google.com/p/perl-devel-nytprof/source/detail?r=1031
Modified:
/trunk/NYTProf.xs
=======================================
--- /trunk/NYTProf.xs Thu Jan 21 05:56:22 2010
+++ /trunk/NYTProf.xs Thu Jan 21 05:56:26 2010
@@ -1878,14 +1878,17 @@
*called_subname_pvp++ = ':';
*called_subname_pvp++ = ':';
if (subr_entry->called_subnam_sv) {
+ /* We create this SV, so we know that it is well-formed, and
has a
+ trailing '\0' */
p = SvPV(subr_entry->called_subnam_sv, len);
+ ++len;
}
else {
- p = "(null)"; len = 6;
+ /* C string constants have a trailing '\0'. */
+ p = "(null)"; len = 7;
}
memcpy(called_subname_pvp, p, len);
called_subname_pvp += len;
- *called_subname_pvp++ = '\0';
if (called_subname_pvp >=
called_subname_pv+sizeof(called_subname_pv))
croak("panic: called_subname_pv buffer overflow on '%s'\n",
called_subname_pv);
} STMT_END;
--
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.
Group hosted at: http://groups.google.com/group/develnytprof-dev
Project hosted at: http://perl-devel-nytprof.googlecode.com
CPAN distribution: http://search.cpan.org/dist/Devel-NYTProf
To post, email: [email protected]
To unsubscribe, email: [email protected]