+2016-06-29 Manish Goregaokar <manish@mozilla.com>
+
+gdb/ChangeLog:
+ * rust-lang.c (rust_get_disr_info): Use strtok_r instead of strsep.
+
2016-06-28 Yao Qi <yao.qi@linaro.org>
* aarch64-tdep.c (aarch64_displaced_step_b): Use int64_t for
if (strncmp (TYPE_FIELD_NAME (type, 0), RUST_ENUM_PREFIX,
strlen (RUST_ENUM_PREFIX)) == 0)
{
- char *name, *tail, *token;
+ char *tail, *token, *name, *saveptr;
unsigned long fieldno;
struct type *member_type;
LONGEST value;
traversed in order to find the field (which may be several fields deep)
and the variantname is the name of the variant of the case when the
field is zero. */
- while ((token = strsep (&tail, "$")) != NULL)
+ for (token = strtok_r (tail, "$", &saveptr);
+ token != NULL;
+ token = strtok_r (NULL, "$", &saveptr))
{
if (sscanf (token, "%lu", &fieldno) != 1)
{
member_type = TYPE_FIELD_TYPE (member_type, fieldno);
}
- if (token >= name + strlen (TYPE_FIELD_NAME (type, 0)))
+ if (token == NULL)
error (_("Invalid form for %s"), RUST_ENUM_PREFIX);
value = unpack_long (member_type, valaddr + embedded_offset);