#endif
-static char *
-save_string (const char *str, size_t len)
-{
- char *s;
-
- s = xmalloc (len + 1);
- memcpy (s, str, len);
- s[len] = '\0';
-
- return s;
-}
-
/* Append another action to perform when the tracepoint triggers. */
static void
* tpoint->num_step_actions));
tpoint->step_actions[tpoint->num_step_actions - 1] = action;
tpoint->step_actions_str[tpoint->num_step_actions - 1]
- = save_string (act_start, act - act_start);
+ = savestring (act_start, act - act_start);
}
else
{
sizeof (*tpoint->actions_str) * tpoint->numactions);
tpoint->actions[tpoint->numactions - 1] = action;
tpoint->actions_str[tpoint->numactions - 1]
- = save_string (act_start, act - act_start);
+ = savestring (act_start, act - act_start);
}
}
}
unpack_varlen_hex (packet, &num);
trace_debug ("Want to get trace buffer, %d bytes at offset 0x%s",
- (int) num, pulongest (offset));
+ (int) num, phex_nz (offset, 0));
tot = (trace_buffer_hi - trace_buffer_lo) - free_space ();
num = (PBUFSIZ - 16) / 2;
convert_int_to_ascii (tbp, own_buf, num);
- own_buf[num] = '\0';
}
static void
user[nbytes] = '\0';
++packet; /* skip the semicolon */
trace_debug ("User is '%s'", user);
+ xfree (tracing_user_name);
tracing_user_name = user;
}
else if (strncmp ("notes:", packet, strlen ("notes:")) == 0)
notes[nbytes] = '\0';
++packet; /* skip the semicolon */
trace_debug ("Notes is '%s'", notes);
+ xfree (tracing_notes);
tracing_notes = notes;
}
else if (strncmp ("tstop:", packet, strlen ("tstop:")) == 0)
stopnote[nbytes] = '\0';
++packet; /* skip the semicolon */
trace_debug ("tstop note is '%s'", stopnote);
+ xfree (tracing_stop_note);
tracing_stop_note = stopnote;
}
else