+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
#include <stdio.h>
#include <ctype.h>
+#include <string.h>
#include <pwd.h>
#include <sys/param.h>
#ifndef _TYPES_
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);
return(0);
}
ldomain[MAXHOSTNAMELEN] = NULL;
- if ((domainp = index(ldomain, '.')) == (char *)NULL) {
+ if ((domainp = strchr(ldomain, '.')) == (char *)NULL) {
nodomain = 1;
return(0);
}
{
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);
}
#include <stdio.h>
#include <errno.h>
+#include <string.h>
#include <signal.h>
#include <pwd.h>
#include <netdb.h>
struct passwd *getpwuid();
#endif
-int errno;
int options;
int rfd2;
int nflag;
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--;
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)
* We always want to call the Berkeley rsh as 'host mumble'
*/
- host = rindex(argv[0], '/');
+ host = strrchr(argv[0], '/');
if (host)
host++;
else