From a38358be86c013594be6169d62cd43ef38150c30 Mon Sep 17 00:00:00 2001
From: "startrekkin.net" <startrekkin@bender.theari.com>
Date: Sat, 22 Jul 2017 14:15:36 -0400
Subject: [PATCH] Remove atr_on_obj uninitialized global variable

---
 hdrs/externs.h |  3 ---
 src/attrib.c   |  1 -
 src/bsd.c      |  4 ++--
 src/conf.c     |  2 +-
 src/cque.c     |  2 --
 src/look.c     | 15 +++------------
 src/wiz.c      |  2 +-
 7 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/hdrs/externs.h b/hdrs/externs.h
index d7eb5d5..82319f6 100644
--- a/hdrs/externs.h
+++ b/hdrs/externs.h
@@ -87,9 +87,6 @@ extern char *scan_list(dbref player, char *command);
 extern void init_timer(void);
 #endif				/* WIN32 */
 
-/* From attrib.c */
-extern dbref atr_on_obj;
-
 /* From bsd.c */
 extern FILE *connlog_fp;
 extern FILE *checklog_fp;
diff --git a/src/attrib.c b/src/attrib.c
index f8c814f..404c1ce 100644
--- a/src/attrib.c
+++ b/src/attrib.c
@@ -50,7 +50,6 @@ StrTree atr_names;
 /** Table of attribute flags. */
 extern PRIV attr_privs_set[];
 extern PRIV attr_privs_view[];
-dbref atr_on_obj = NOTHING;
 
 /** A flag to show if we're in the middle of a @wipe (this changes
  * behaviour for atr_clr()).  Yes, this is gross and ugly, but it
diff --git a/src/bsd.c b/src/bsd.c
index e4cb997..38e428f 100644
--- a/src/bsd.c
+++ b/src/bsd.c
@@ -2210,9 +2210,9 @@ process_output(DESC *d)
 
   for (qp = &d->output.head; ((cur = *qp) != NULL);) {
 #ifdef COMPILE_CONSOLE
-    if (d->descriptor == 0)
+    if (d->descriptor == 0) {
       cnt = write(STDOUT_FILENO, cur->start, cur->nchars);
-    else
+    }
 #else /* COMPILE_CONSOLE */
 #ifdef HAS_OPENSSL
     if (d->ssl) {
diff --git a/src/conf.c b/src/conf.c
index 026ea53..c32aa36 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -865,7 +865,7 @@ config_set(const char *opt, char *val, int source, int restrictions)
     } else {
       if(source == 0)
 	do_rawlog(LT_ERR, T("CONFIG: lock_command %s requires a lock boolexp.\n"), val);
-	return 0;
+      return 0;
     }
     return 1;
   } else if (!strcasecmp(opt, "restrict_command")) {
diff --git a/src/cque.c b/src/cque.c
index 4f322ce..b3111c4 100644
--- a/src/cque.c
+++ b/src/cque.c
@@ -450,8 +450,6 @@ queue_attribute_useatr(dbref executor, ATTR *a, dbref enactor)
   char *start, *command;
   dbref powinherit = NOTHING;
   dbref local_ooref;
-  if(AL_FLAGS(a) & AF_POWINHERIT)
-    powinherit = atr_on_obj;
   start = safe_atr_value(a);
   command = start;
   /* Trim off $-command or ^-command prefix */
diff --git a/src/look.c b/src/look.c
index 3dae752..15ad7fe 100644
--- a/src/look.c
+++ b/src/look.c
@@ -108,10 +108,7 @@ look_exits(dbref player, dbref loc, const char *exit_name)
     global_eval_context.wenv[0] = arg;
     sp = save = safe_atr_value(a);
     bp = buff;
-    if(AL_FLAGS(a) & AF_POWINHERIT)
-              exec_target = atr_on_obj;
-      else
-              exec_target = loc;
+    exec_target = loc;
 
     process_expression(buff, &bp, &sp, exec_target, ((AL_FLAGS(a) & AF_POWINHERIT ) ? loc : player), player,
 		       PE_DEFAULT, PT_DEFAULT, NULL);
@@ -281,10 +278,7 @@ look_contents(dbref player, dbref loc, const char *contents_name)
     global_eval_context.wenv[1] = arg2;
     sp = save = safe_atr_value(a);
     bp = buff;
-    if(AL_FLAGS(a) & AF_POWINHERIT)
-	    exec_target = atr_on_obj; 
-    else
-	    exec_target = loc;
+    exec_target = loc;
     process_expression(buff, &bp, &sp, exec_target, ((AL_FLAGS(a) & AF_POWINHERIT ) ? loc : player), player,
 		       PE_DEFAULT, PT_DEFAULT, NULL);
     *bp = '\0';
@@ -1040,10 +1034,7 @@ do_inventory(dbref player)
     global_eval_context.wenv[0] = arg;
     global_eval_context.wenv[1] = arg2;
     sp = save = safe_atr_value(invfmt);
-    if(AL_FLAGS(invfmt) & AF_POWINHERIT)
-      exec_target = atr_on_obj;
-    else
-      exec_target = player;
+    exec_target = player;
     bp = buff;
     process_expression(buff, &bp, &sp, exec_target, player, player, PE_DEFAULT, PT_DEFAULT, NULL);
     *bp = '\0';
diff --git a/src/wiz.c b/src/wiz.c
index 23853c5..07708da 100644
--- a/src/wiz.c
+++ b/src/wiz.c
@@ -1762,7 +1762,7 @@ fill_search_spec(dbref player, const char *owner, int nargs, const char **args,
       spec->high = parse_integer(restriction + offset);
       if (!GoodObject(spec->high))
 	spec->high = db_top - 1;
-	continue;
+      continue;
       }
     }
     if (!class || !*class || !restriction)
-- 
2.30.2