summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1994-07-16 06:26:34 +0000
committerTheodore Tso <tytso@mit.edu>1994-07-16 06:26:34 +0000
commit4f13d2324dda536c2aee43898647f6a5d0c1dcda (patch)
treefc9d27920d4945c039837bfb8990d09285820e31 /src
parent36a25dca2bcaff02ac5988994672f367600703c0 (diff)
downloadkrb5-4f13d2324dda536c2aee43898647f6a5d0c1dcda.tar.gz
krb5-4f13d2324dda536c2aee43898647f6a5d0c1dcda.tar.xz
krb5-4f13d2324dda536c2aee43898647f6a5d0c1dcda.zip
index->strchr, rindex->strrchr, add (char *) cast to malloc, have
proper include for the string functions. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3990 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/appl/bsd/ChangeLog6
-rw-r--r--src/appl/bsd/kcmd.c7
-rw-r--r--src/appl/bsd/krsh.c10
3 files changed, 15 insertions, 8 deletions
diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog
index af5a7309c..d22c0fcd6 100644
--- a/src/appl/bsd/ChangeLog
+++ b/src/appl/bsd/ChangeLog
@@ -1,3 +1,9 @@
+Sat Jul 16 02:24:31 1994 Theodore Y. Ts'o (tytso at tsx-11)
+
+ * kcmd.c:
+ * krsh.c: index->strchr, rindex->strrchr, add (char *) cast to
+ malloc, have proper include for the string functions.
+
Fri Jul 15 15:03:11 1994 Theodore Y. Ts'o (tytso at tsx-11)
* krcp.c: add utimes() emulation for systems that only have the
diff --git a/src/appl/bsd/kcmd.c b/src/appl/bsd/kcmd.c
index 807009a6c..2163a65c1 100644
--- a/src/appl/bsd/kcmd.c
+++ b/src/appl/bsd/kcmd.c
@@ -32,6 +32,7 @@ static char sccsid[] = "derived from @(#)rcmd.c 5.17 (Berkeley) 6/27/88";
#include <stdio.h>
#include <ctype.h>
+#include <string.h>
#include <pwd.h>
#include <sys/param.h>
#ifndef _TYPES_
@@ -129,7 +130,7 @@ kcmd(sock, ahost, rport, locuser, remuser, cmd, fd2p, service, realm,
sin_len = strlen(host_save) + strlen(service)
+ (realm ? strlen(realm): 0) + 3;
if ( sin_len < 20 ) sin_len = 20;
- tmpstr = malloc(sin_len);
+ tmpstr = (char *) malloc(sin_len);
if ( tmpstr == (char *) 0){
fprintf(stderr,"kcmd: no memory\n");
return(-1);
@@ -594,7 +595,7 @@ _checkhost(rhost, lhost, len)
return(0);
}
ldomain[MAXHOSTNAMELEN] = NULL;
- if ((domainp = index(ldomain, '.')) == (char *)NULL) {
+ if ((domainp = strchr(ldomain, '.')) == (char *)NULL) {
nodomain = 1;
return(0);
}
@@ -630,7 +631,7 @@ char *sp;
{
register char *ret;
- if((ret = malloc((unsigned) strlen(sp)+1)) == NULL) {
+ if((ret = (char *) malloc((unsigned) strlen(sp)+1)) == NULL) {
fprintf(stderr, "no memory for saving args\n");
exit(1);
}
diff --git a/src/appl/bsd/krsh.c b/src/appl/bsd/krsh.c
index 8e878b308..8551bd32e 100644
--- a/src/appl/bsd/krsh.c
+++ b/src/appl/bsd/krsh.c
@@ -44,6 +44,7 @@ static char sccsid[] = "@(#)rsh.c 5.7 (Berkeley) 9/20/88";
#include <stdio.h>
#include <errno.h>
+#include <string.h>
#include <signal.h>
#include <pwd.h>
#include <netdb.h>
@@ -67,7 +68,6 @@ int error();
struct passwd *getpwuid();
#endif
-int errno;
int options;
int rfd2;
int nflag;
@@ -109,8 +109,8 @@ void try_normal();
int debug_port = 0;
#endif /* KERBEROS */
- if (rindex(argv[0], '/'))
- argv[0] = rindex(argv[0], '/')+1;
+ if (strrchr(argv[0], '/'))
+ argv[0] = strrchr(argv[0], '/')+1;
if ( argc < 2 ) goto usage;
argc--;
@@ -254,7 +254,7 @@ void try_normal();
cc = 0;
for (ap = argv; *ap; ap++)
cc += strlen(*ap) + 1;
- cp = args = malloc(cc);
+ cp = args = (char *) malloc(cc);
for (ap = argv; *ap; ap++) {
(void) strcpy(cp, *ap);
while (*cp)
@@ -445,7 +445,7 @@ void try_normal(argv)
* We always want to call the Berkeley rsh as 'host mumble'
*/
- host = rindex(argv[0], '/');
+ host = strrchr(argv[0], '/');
if (host)
host++;
else