cat_n_send: get rid of bogus dependency on snprintf(). This should
possibly go in the CVS repo.
git-svn-id: svn://svn.valgrind.org/vex/trunk@384 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/head20041019/coregrind/vg_libpthread.c b/head20041019/coregrind/vg_libpthread.c
index cb01723..a10eaf0 100644
--- a/head20041019/coregrind/vg_libpthread.c
+++ b/head20041019/coregrind/vg_libpthread.c
@@ -275,12 +275,27 @@
static void cat_n_send ( char* s1, char* s2, char* s3 )
{
- char buf[1000];
+# define N_BUF 1000
+ int i;
+ char buf[N_BUF];
if (get_pt_trace_level() >= 0) {
- snprintf(buf, sizeof(buf), "%s%s%s", s1, s2, s3);
- buf[sizeof(buf)-1] = '\0';
+ i = 0;
+ while (*s1) {
+ if (i >= N_BUF) break;
+ buf[i++] = *s1++;
+ }
+ while (*s2) {
+ if (i >= N_BUF) break;
+ buf[i++] = *s2++;
+ }
+ while (*s3) {
+ if (i >= N_BUF) break;
+ buf[i++] = *s3++;
+ }
+ buf[i] = 0;
VALGRIND_INTERNAL_PRINTF(buf);
}
+# undef N_BUF
}
static void oh_dear ( char* fn, char* aux, char* s )