This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[RFC] maint.c, move assignment to outside of IF expr


OK?

The attatched moves an assignment out of an if conditional.  GCC was
complaining about it.
I'm guessing that the coder didn't intend to write ``=='' :-)

	enjoy,
		Andrew
Tue Mar 28 15:20:14 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* maint.c (maintenance_do_deprecate): Avoid assignment within IF
 	condition.

Index: maint.c
===================================================================
RCS file: /cvs/src/src/gdb/maint.c,v
retrieving revision 1.6
diff -p -r1.6 maint.c
*** maint.c	2000/03/25 15:32:18	1.6
--- maint.c	2000/03/28 05:25:57
*************** maintenance_do_deprecate (char *text, in
*** 425,434 ****
    if (deprecate)
      {
        /* look for a replacement command */
!       if (start_ptr = strchr (text, '\"'))
  	{
  	  start_ptr++;
! 	  if (end_ptr = strrchr (start_ptr, '\"'))
  	    {
  	      len = end_ptr - start_ptr;
  	      start_ptr[len] = '\0';
--- 425,436 ----
    if (deprecate)
      {
        /* look for a replacement command */
!       start_ptr = strchr (text, '\"');
!       if (start_ptr != NULL)
  	{
  	  start_ptr++;
! 	  end_ptr = strrchr (start_ptr, '\"');
! 	  if (end_ptr != NULL)
  	    {
  	      len = end_ptr - start_ptr;
  	      start_ptr[len] = '\0';

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]