ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/mgflib/object.c
(Generate patch)

Comparing ray/src/cv/mgflib/object.c (file contents):
Revision 1.2 by greg, Wed Jun 22 15:33:46 1994 UTC vs.
Revision 1.5 by greg, Wed Nov 29 16:46:56 1995 UTC

# Line 18 | Line 18 | char   **obj_name;                     /* name list */
18  
19   static int      obj_maxname;            /* allocated list size */
20  
21 < #define ALLOC_INC       16              /* list increment */
21 > #define ALLOC_INC       16              /* list increment ( > 1 ) */
22  
23  
24   int
# Line 28 | Line 28 | char   **av;
28   {
29          if (ac == 1) {                          /* just pop top object */
30                  if (obj_nnames < 1)
31 <                        return(MG_OK);          /* should be error? */
31 >                        return(MG_ECNTXT);
32                  free((MEM_PTR)obj_name[--obj_nnames]);
33                  obj_name[obj_nnames] = NULL;
34                  return(MG_OK);
35          }
36          if (ac != 2)
37                  return(MG_EARGC);
38 <        if (obj_nnames >= obj_maxname) {        /* enlarge array */
38 >        if (!isname(av[1]))
39 >                return(MG_EILL);
40 >        if (obj_nnames >= obj_maxname-1) {      /* enlarge array */
41                  if (!obj_maxname)
42                          obj_name = (char **)malloc(
43                                  (obj_maxname=ALLOC_INC)*sizeof(char *));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines