#define BY_NAME 2
#define CLASS 3
+/* Function Name: UserState
+ * Description: Convert a numeric state into a descriptive string.
+ * Arguments: state value
+ * Returns: pointer to statically allocated string.
+ */
+
+static char *states[] = { "Not registered",
+ "Active",
+ "Half registered",
+ "Marked for deletion",
+ "Not registerable" };
+
+static char *UserState(state)
+int state;
+{
+ if (state < 0 || state > 4)
+ return("Unknown");
+ return(states[state]);
+}
+
+
/* Function Name: PrintUserName
* Description: Print name of a user.
* Arguments: info - the information about a user.
info[U_UID], info[U_SHELL], info[U_CLASS]);
Put_message(buf);
sprintf(buf, "Account is: %-10s Encrypted MIT ID number: %s",
- atoi(info[U_STATE]) ? "active" : "inactive", info[U_MITID]);
+ UserState(atoi(info[U_STATE])), info[U_MITID]);
Put_message(buf);
sprintf(buf, MOD_FORMAT, info[U_MODBY], info[U_MODTIME],info[U_MODWITH]);
Put_message(buf);