$OpenBSD: patch-src_filenames_c,v 1.2 2004/08/08 14:02:11 sturm Exp $
--- src/filenames.c.orig	Mon Jun  7 14:03:15 2004
+++ src/filenames.c	Mon Aug  2 13:30:34 2004
@@ -121,7 +121,7 @@ if (str == NULL)
  
 if (!IsFileSep(str[strlen(str)-1]))
    {
-   strcat(str,FILE_SEPARATOR_STR);
+   (void)strlcat(str,FILE_SEPARATOR_STR,CF_BUFSIZE);
    }
 }
 
@@ -225,7 +225,7 @@ char *CanonifyName(char *str)
   char *sp;
 
 memset(buffer,0,CF_BUFSIZE);
-strcpy(buffer,str);
+(void)strlcpy(buffer,str,sizeof(buffer));
 
 for (sp = buffer; *sp != '\0'; sp++)
     {
@@ -246,7 +246,7 @@ char *Space2Score(char *str)
   char *sp;
 
 memset(buffer,0,CF_BUFSIZE);
-strcpy(buffer,str);
+(void)strlcpy(buffer,str,sizeof(buffer));
 
 for (sp = buffer; *sp != '\0'; sp++)
     {
@@ -267,7 +267,7 @@ char *ASUniqueName(char *str) /* generat
   struct Item *ip;
 
 memset(buffer,0,CF_BUFSIZE);
-strcpy(buffer,str);
+(void)strlcpy(buffer,str,sizeof(buffer));
 
 for (ip = VADDCLASSES; ip != NULL; ip=ip->next)
    {
@@ -276,8 +276,8 @@ for (ip = VADDCLASSES; ip != NULL; ip=ip
       break;
       }
    
-   strcat(buffer,".");
-   strcat(buffer,ip->name);
+   (void)strlcat(buffer,".",sizeof(buffer));
+   (void)strlcat(buffer,ip->name,sizeof(buffer));
    }
 
 return buffer;
@@ -365,9 +365,9 @@ if (strstr(pathbuf, _PATH_RSRCFORKSPEC) 
              struct TidyPattern tpat;
              struct stat sbuf;
              
-             strcpy(currentpath,pathbuf);
+             (void)strlcpy(currentpath,pathbuf,sizeof(currentpath));
              DeleteSlash(currentpath);
-             strcat(currentpath,".cf-moved");
+             (void)strlcat(currentpath,".cf-moved",sizeof(currentpath));
              snprintf(OUTPUT,CF_BUFSIZE,"Moving obstructing file/link %s to %s to make directory",pathbuf,currentpath);
              CfLog(cferror,OUTPUT,"");
              
@@ -640,7 +640,7 @@ for (sp = src+rootlen; *sp != '\0'; sp++
       return false;
       }
    
-   strcat(dest,node);
+   (void)strlcat(dest,node,CF_BUFSIZE);
    }
  
 return true;
@@ -702,7 +702,7 @@ if (strlen(str) >= CF_BUFSIZE)
    {
    char *tmp;
    tmp = malloc(40+strlen(str));
-   sprintf(tmp,"String too long in ToUpperStr: %s",str);
+   snprintf(tmp,CF_BUFSIZE,"String too long in ToUpperStr: %s",str);
    FatalError(tmp);
    }
 
