public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* RFA: strdup -> xstrdup
@ 1999-11-22  0:59 Andrew Cagney
  1999-11-22 10:07 ` James Ingham
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cagney @ 1999-11-22  0:59 UTC (permalink / raw)
  To: Insight (GDB GUI)

Hello,

The attached replaces strdup() calls with liberty's slightly more robust
xstrdup().

Ok?
	Andrew
Thu Nov 18 18:19:59 1999  Andrew Cagney  <cagney@b1.cygnus.com>

	* gdbtk.c (tk_command), gdbtk-hooks.c (gdbtk_readline),
 	gdbtk-variable.c (variable_type): Replace strdup with xstrdup.

Index: gdbtk-hooks.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdbtk-hooks.c,v
retrieving revision 2.31
diff -p -r2.31 gdbtk-hooks.c
*** gdbtk-hooks.c	1999/10/17 04:23:08	2.31
--- gdbtk-hooks.c	1999/11/22 07:39:29
*************** gdbtk_readline (prompt)
*** 470,476 ****
  
    if (result == TCL_OK)
      {
!       return (strdup (gdbtk_interp->result));
      }
    else
      {
--- 470,476 ----
  
    if (result == TCL_OK)
      {
!       return (xstrdup (gdbtk_interp->result));
      }
    else
      {
Index: gdbtk-variable.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdbtk-variable.c,v
retrieving revision 2.15
diff -p -r2.15 gdbtk-variable.c
*** gdbtk-variable.c	1999/10/05 10:47:59	2.15
--- gdbtk-variable.c	1999/11/22 07:39:35
*************** variable_type (interp, objc, objv, var)
*** 1227,1233 ****
    result = call_gdb_type_print (val);
    if (result == TCL_OK)
      {
!       string = strdup (Tcl_GetStringFromObj (get_call_output (), NULL));
        first = string;
  
        /* gdb will print things out like "struct {...}" for anonymous structs.
--- 1227,1233 ----
    result = call_gdb_type_print (val);
    if (result == TCL_OK)
      {
!       string = xstrdup (Tcl_GetStringFromObj (get_call_output (), NULL));
        first = string;
  
        /* gdb will print things out like "struct {...}" for anonymous structs.
Index: gdbtk.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdbtk.c,v
retrieving revision 2.145
diff -p -r2.145 gdbtk.c
*** gdbtk.c	1999/09/23 22:46:57	2.145
--- gdbtk.c	1999/11/22 07:39:37
*************** tk_command (cmd, from_tty)
*** 639,645 ****
  
    retval = Tcl_Eval (gdbtk_interp, cmd);
  
!   result = strdup (gdbtk_interp->result);
  
    old_chain = make_cleanup (free, result);
  
--- 639,645 ----
  
    retval = Tcl_Eval (gdbtk_interp, cmd);
  
!   result = xstrdup (gdbtk_interp->result);
  
    old_chain = make_cleanup (free, result);
  

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-11-22 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-22  0:59 RFA: strdup -> xstrdup Andrew Cagney
1999-11-22 10:07 ` James Ingham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).