add-strcpy-for-openbsd-20030623
authorJim Rees <rees@umich.edu>
Mon, 23 Jun 2003 21:27:39 +0000 (21:27 +0000)
committerJim Rees <rees@umich.edu>
Mon, 23 Jun 2003 21:27:39 +0000 (21:27 +0000)
add strcpy() to afs_util.c for OpenBSD 3.3.
Please don't look at my previous attempt to fix this.

src/afs/OBSD/osi_machdep.h
src/afs/afs_prototypes.h
src/afs/afs_util.c

index 0978ae8..1eede88 100644 (file)
@@ -83,7 +83,7 @@ extern struct timeval time;
 /* str */
 #define afs_strcasecmp(s1, s2) strncasecmp((s1), (s2), 65535)
 #ifdef AFS_OBSD34_ENV
-#define strcpy(s1, s2)         strncpy((s1), (s2), 65535)
+#define strcpy(s1, s2)         afs_strcpy((s1), (s2))
 #else
 #define afs_strcat(s1, s2)     strcat((s1), (s2))
 #endif
index a5dfe32..4a221b1 100644 (file)
@@ -674,6 +674,9 @@ extern int afs_strcasecmp(char *s1, char *s2);
 #ifndef afs_strcat
 extern char *afs_strcat(char *s1, char *s2);
 #endif
+#ifdef AFS_OBSD34_ENV
+extern char *afs_strcpy(char *s1, char *s2);
+#endif
 #ifndef afs_strchr
 extern char *afs_strchr(char *s, int c);
 #endif
index 30aa9bb..bd83a96 100644 (file)
@@ -106,6 +106,18 @@ char *afs_strcat(char *s1, char *s2)
 }
 #endif
 
+#ifdef AFS_OBSD34_ENV
+char *afs_strcpy(char *s1, char *s2)
+{
+    char *os1;
+
+    os1 = s1;
+    while ((*s1++ = *s2++) != '\0')
+       ;
+    return os1;
+}
+#endif
+
 #ifndef afs_strchr
 char *afs_strchr(char *s, int c)
 {