diff --git a/src/mged/clone.c b/src/mged/clone.c index 70665e0746..f315166c7b 100644 --- a/src/mged/clone.c +++ b/src/mged/clone.c @@ -309,6 +309,7 @@ copy_v4_solid(struct db_i *_dbip, struct directory *proto, struct clone_state *s if ((dp == RT_DIR_NULL) || (db_alloc(_dbip, dp, proto->d_len) < 0)) { Tcl_AppendResult(s->interp, "An error has occurred while adding a new object to the database.\n", (char *)NULL); Tcl_AppendResult(s->interp, ERROR_RECOVERY_SUGGESTION, (char *)NULL); + return; } /* get an in-memory reference to the object being copied */ diff --git a/src/mged/edsol.c b/src/mged/edsol.c index 465b78566d..1719af2b6b 100644 --- a/src/mged/edsol.c +++ b/src/mged/edsol.c @@ -1317,8 +1317,6 @@ label_edited_solid( const mat_t xform, struct rt_db_internal *ip) { - int npl = 0; - // TODO - is es_int the same as ip here? If not, why not? RT_CK_DB_INTERNAL(ip); @@ -1334,12 +1332,12 @@ label_edited_solid( } // If there is no editing-aware labeling, use standard librt labels if (OBJ[ip->idb_type].ft_labels) { - npl = OBJ[ip->idb_type].ft_labels(pl, max_pl, xform, &s->s_edit.es_int, &s->tol.tol); + OBJ[ip->idb_type].ft_labels(pl, max_pl, xform, &s->s_edit.es_int, &s->tol.tol); return; } // If we have nothing, NULL the string - pl[npl].str[0] = '\0'; + pl[0].str[0] = '\0'; } diff --git a/src/mged/track.c b/src/mged/track.c index b8a6a0dfdd..785a673ef0 100644 --- a/src/mged/track.c +++ b/src/mged/track.c @@ -71,9 +71,12 @@ f_amtrack(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[ MGED_CK_CMD(ctp); struct mged_state *s = ctp->s; - int item_default = 1000; /* GIFT region ID */ - int mat_default = 1; /* GIFT material code */ - int los_default = 100; /* Line-of-sight estimate */ + // TODO - need to confirm the actual intent of this code is to have the + // assignments to default made in subsequent function logic persist beyond + // one call to f_amtrack. + static int item_default = 1000; /* GIFT region ID */ + static int mat_default = 1; /* GIFT material code */ + static int los_default = 100; /* Line-of-sight estimate */ fastf_t fw[3], lw[3], iw[3], dw[3], tr[3]; char solname[12], regname[12], grpname[9], oper[3];