#include <sys/types.h>
#include <stdio.h>
-#include <strings.h>
+#include <string.h>
#include <sys/file.h>
#include <krb.h>
#include <ctype.h>
int k_errno;
char *whoami;
- if ((whoami = rindex(argv[0], '/')) == NULL)
+ if ((whoami = strrchr(argv[0], '/')) == NULL)
whoami = argv[0];
else
whoami++;
status = mr_connect(NULL);
if (status) {
- com_err(whoami, status, " while connecting to Moira");
+ com_err(whoami, status, "while connecting to Moira");
exit(1);
}
status = mr_motd(&motd);
if (status) {
- com_err(whoami, status, " unable to check server status");
+ com_err(whoami, status, "unable to check server status");
leave(1);
}
if (motd) {
status = mr_auth("chfn"); /* Don't use argv[0] - too easy to fake */
if (status) {
com_err(whoami, status,
- " while authenticating -- run \"kinit\" and try again.");
+ "while authenticating -- run \"kinit\" and try again.");
leave(1);
}
if (status = mr_query("get_finger_by_login", q_argc, q_argv,
get_user_info, (char *) &old_info))
{
- com_err(whoami, status, " while getting user information.");
+ com_err(whoami, status, "while getting user information.");
leave(2);
}
if (status = mr_query("update_finger_by_login", q_argc, q_argv,
scream, (char *)NULL))
{
- com_err(whoami, status, " while updating finger information.");
+ com_err(whoami, status, "while updating finger information.");
leave(1);
}
GETINFO("Office address (Exs: E40-342 or 2-108)",
office_address, FALSE);
GETINFO("Office phone (Ex: 3-1300)", office_phone, TRUE);
- GETINFO("MIT department (Exs: 9, Biology, Information Services",
+ GETINFO("MIT department (Exs: 9, Biology, Information Services)",
mit_department, FALSE);
GETINFO("MIT year (Exs: 1989, '91, Faculty, Grad)", mit_year, FALSE);
}