* mi/mi-parse.c (mi_parse): Remove incorrect sizeof.
authorTom Tromey <tromey@redhat.com>
Fri, 29 Apr 2011 18:44:15 +0000 (18:44 +0000)
committerTom Tromey <tromey@redhat.com>
Fri, 29 Apr 2011 18:44:15 +0000 (18:44 +0000)
(mi_parse): Likewise.
* breakpoint.c (break_range_command): Use sizeof char*, not
char**.
(create_breakpoint): Likewise.
(parse_breakpoint_sals): Likewise.

gdb/ChangeLog
gdb/breakpoint.c
gdb/mi/mi-parse.c

index 77b7a97d60c4885166abc8e9a2069029da8ce370..37cf2cff8f4fd6119fab51a3bf330f46c024e873 100644 (file)
@@ -1,3 +1,12 @@
+2011-04-29  Tom Tromey  <tromey@redhat.com>
+
+       * mi/mi-parse.c (mi_parse): Remove incorrect sizeof.
+       (mi_parse): Likewise.
+       * breakpoint.c (break_range_command): Use sizeof char*, not
+       char**.
+       (create_breakpoint): Likewise.
+       (parse_breakpoint_sals): Likewise.
+
 2011-04-29  Pedro Alves  <pedro@codesourcery.com>
 
        * linux-nat.c (linux_child_remove_fork_catchpoint)
index 01bb08cbeffdfaf1276722e25659e57334d730b0..b9d76c7cde90cd98d4ca3751d3c121e53830f306 100644 (file)
@@ -7698,7 +7698,7 @@ parse_breakpoint_sals (char **address,
     }
   /* For any SAL that didn't have a canonical string, fill one in.  */
   if (sals->nelts > 0 && canonical->canonical == NULL)
-    canonical->canonical = xcalloc (sals->nelts, sizeof (char **));
+    canonical->canonical = xcalloc (sals->nelts, sizeof (char *));
   if (addr_start != (*address))
     {
       int i;
@@ -7917,7 +7917,7 @@ create_breakpoint (struct gdbarch *gdbarch,
       sals = decode_static_tracepoint_spec (&arg);
 
       copy_arg = savestring (addr_start, arg - addr_start);
-      canonical.canonical = xcalloc (sals.nelts, sizeof (char **));
+      canonical.canonical = xcalloc (sals.nelts, sizeof (char *));
       for (i = 0; i < sals.nelts; i++)
        canonical.canonical[i] = xstrdup (copy_arg);
       goto done;
@@ -8573,7 +8573,7 @@ break_range_command (char *arg, int from_tty)
 
   /* canonical_end can be NULL if it was of the form "*0xdeadbeef".  */
   if (canonical_end.canonical == NULL)
-    canonical_end.canonical = xcalloc (1, sizeof (char **));
+    canonical_end.canonical = xcalloc (1, sizeof (char *));
   /* Add the string if not present.  */
   if (arg_start != arg && canonical_end.canonical[0] == NULL)
     canonical_end.canonical[0] = savestring (arg_start, arg - arg_start);
index fcaf151242114b2e2530fcc2767d57d4929a193b..a46274aab9a6c81cb37136d4612f1c2da804c363 100644 (file)
@@ -253,7 +253,7 @@ mi_parse (char *cmd, char **token)
   /* Find/skip any token and then extract it. */
   for (chp = cmd; *chp >= '0' && *chp <= '9'; chp++)
     ;
-  *token = xmalloc ((chp - cmd + 1) * sizeof (char *));
+  *token = xmalloc (chp - cmd + 1);
   memcpy (*token, cmd, (chp - cmd));
   (*token)[chp - cmd] = '\0';
 
@@ -276,7 +276,7 @@ mi_parse (char *cmd, char **token)
 
     for (; *chp && !isspace (*chp); chp++)
       ;
-    parse->command = xmalloc ((chp - tmp + 1) * sizeof (char *));
+    parse->command = xmalloc (chp - tmp + 1);
     memcpy (parse->command, tmp, chp - tmp);
     parse->command[chp - tmp] = '\0';
   }
This page took 0.033607 seconds and 4 git commands to generate.