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

gEDA-cvs: CVS update: g_hook.c



  User: cnieves 
  Date: 06/12/13 16:45:57

  Modified:    .        g_hook.c
  Log:
  * src/g_hook.c: Improved error detection in g_add_attrib.
  
    This should fix bug #1599582.
  
  
  
  
  Revision  Changes    Path
  1.12      +15 -1     eda/geda/gaf/gschem/src/g_hook.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: g_hook.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/g_hook.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- g_hook.c	5 Dec 2006 22:52:07 -0000	1.11
  +++ g_hook.c	13 Dec 2006 21:45:57 -0000	1.12
  @@ -149,10 +149,24 @@
     vis = SCM_NFALSEP(scm_vis);
   
     for (i=0; i<=SCM_INUM(scm_length(scm_show))-1; i++) {
  +    /* Check every element in the list. It should be a string! */
  +    SCM_ASSERT(scm_list_ref(scm_show, SCM_MAKINUM(i)), 
  +	       scm_show,
  +	       SCM_ARG5, "add-attribute-to-object"); 
  +    SCM_ASSERT(SCM_STRINGP(scm_list_ref(scm_show, SCM_MAKINUM(i))), 
  +	       scm_show,
  +	       SCM_ARG5, "add-attribute-to-object"); 
  +    
       value = SCM_STRING_CHARS(scm_list_ref(scm_show, SCM_MAKINUM(i)));
  +    
  +    SCM_ASSERT(value, scm_show,
  +	       SCM_ARG5, "add-attribute-to-object"); 
  +
  +    /* Only "name" or "value" strings are allowed */
       SCM_ASSERT(!((strcasecmp(value, "name") != 0) &&
   		 (strcasecmp(value, "value") != 0) ), scm_show,
   	       SCM_ARG5, "add-attribute-to-object"); 
  +    
       /* show = 1 => show value; 
          show = 2 => show name; 
          show = 3 => show both */
  
  
  


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