[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (fcb24561236102bbb7a7e891b97cdc6f38ea5a47)



The branch, master has been updated
       via  fcb24561236102bbb7a7e891b97cdc6f38ea5a47 (commit)
      from  ca88ff9c45d72fa7954ebccb717e7d2cb5d602a8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/action.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)


=================
 Commit Messages
=================

commit fcb24561236102bbb7a7e891b97cdc6f38ea5a47
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Check for NULL element name when adding attributes.
    
    When setting element attributes, if the element is as yet unnamed,
    use an "unnamed element" title instead of segfaulting.

:100644 100644 961decf... 0a85391... M	src/action.c

=========
 Changes
=========

commit fcb24561236102bbb7a7e891b97cdc6f38ea5a47
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Check for NULL element name when adding attributes.
    
    When setting element attributes, if the element is as yet unnamed,
    use an "unnamed element" title instead of segfaulting.

diff --git a/src/action.c b/src/action.c
index 961decf..0a85391 100644
--- a/src/action.c
+++ b/src/action.c
@@ -7821,8 +7821,15 @@ ActionAttributes (int argc, char **argv, int x, int y)
 	      }
 	  }
 
-	buf = (char *) malloc (strlen (NAMEONPCB_NAME(e)) + strlen ("Element X Attributes"));
-	sprintf(buf, "Element %s Attributes", NAMEONPCB_NAME(e));
+	if (NAMEONPCB_NAME(e))
+	  {
+	    buf = (char *) malloc (strlen (NAMEONPCB_NAME(e)) + strlen ("Element X Attributes"));
+	    sprintf(buf, "Element %s Attributes", NAMEONPCB_NAME(e));
+	  }
+	else
+	  {
+	    buf = strdup ("Unnamed Element Attributes");
+	  }
 	gui->edit_attributes(buf, &(e->Attributes));
 	free (buf);
 	break;




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs