From: Jim Rees Date: Mon, 23 Jun 2003 21:27:39 +0000 (+0000) Subject: add-strcpy-for-openbsd-20030623 X-Git-Tag: openafs-devel-1_3_50~160 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5db7b8a88cd0f570e851333228f1f62b71d8c124;p=packages%2Fo%2Fopenafs.git add-strcpy-for-openbsd-20030623 add strcpy() to afs_util.c for OpenBSD 3.3. Please don't look at my previous attempt to fix this. --- diff --git a/src/afs/OBSD/osi_machdep.h b/src/afs/OBSD/osi_machdep.h index 0978ae821..1eede8875 100644 --- a/src/afs/OBSD/osi_machdep.h +++ b/src/afs/OBSD/osi_machdep.h @@ -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 diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index a5dfe3208..4a221b1af 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -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 diff --git a/src/afs/afs_util.c b/src/afs/afs_util.c index 30aa9bb6d..bd83a96a2 100644 --- a/src/afs/afs_util.c +++ b/src/afs/afs_util.c @@ -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) {