ca76526b11
if it exists.
45 lines
938 B
Plaintext
45 lines
938 B
Plaintext
--- etc/afpd/gettok.c.orig Thu Jul 21 03:56:30 1994
|
|
+++ etc/afpd/gettok.c Mon Nov 8 12:22:07 1999
|
|
@@ -4,6 +4,7 @@
|
|
*/
|
|
|
|
#include <sys/param.h>
|
|
+#include <string.h>
|
|
#include <strings.h>
|
|
#include <ctype.h>
|
|
#include <pwd.h>
|
|
@@ -11,6 +12,7 @@
|
|
static char *l_curr;
|
|
static char *l_end;
|
|
|
|
+void
|
|
initline( len, line )
|
|
int len;
|
|
char *line;
|
|
@@ -137,7 +139,7 @@
|
|
}
|
|
} else {
|
|
u = t;
|
|
- if (( q = index( t, '/' )) == NULL ) {
|
|
+ if (( q = strchr( t, '/' )) == NULL ) {
|
|
t = "";
|
|
} else {
|
|
*q = '\0';
|
|
@@ -148,12 +150,12 @@
|
|
*token = '\0';
|
|
return;
|
|
}
|
|
- strcpy( buf, pwent->pw_dir );
|
|
+ (void)strlcpy( buf, pwent->pw_dir, sizeof(buf) );
|
|
if ( *t != '\0' ) {
|
|
- strcat( buf, "/" );
|
|
- strcat( buf, t );
|
|
+ (void)strlcat( buf, "/", sizeof(buf) );
|
|
+ (void)strlcat( buf, t, sizeof(buf) );
|
|
}
|
|
- strcpy( token, buf );
|
|
+ (void)strlcpy( token, buf, sizeof(token) );
|
|
}
|
|
return;
|
|
}
|