If you bothered using strncpy shouldn't you have bothered using strncat? 

And I thought there was a #define for the MAXPATHNAME or something
similar. Would make this nicely platform indiependant and not just
generically "big".

--timball

On Fri, Mar 29, 2002 at 10:11:41PM -0500, Ed Sweetman wrote:
>  
> -char old_path[1024]="/\0";
> +char old_path[5120]="/\0";
>  
>  FileSelector::FileSelector(const char *windowtitle)
>  {
> @@ -72,9 +72,10 @@
>          current = readdir(dir);
>          for(i=0;(current=readdir(dir))!=NULL;i++){
>              if(current->d_type==DT_DIR){
> -             char *temp_subdir = new char[1024];
> -             strcpy(temp_subdir, subdirs);
> +             char *temp_subdir = new char[5120];
> +             strncpy(temp_subdir, subdirs,5120);
>               strcat(temp_subdir,current->d_name);
+               strncat(temp_subdir, current->d_name, 5120);
> +             temp_subdir[5120]='\0';

--timball

-- 
        GPG key available on pgpkeys.mit.edu
pub  1024D/511FBD54 2001-07-23 Timothy Lu Hu Ball <[EMAIL PROTECTED]>
Key fingerprint = B579 29B0 F6C8 C7AA 3840  E053 FE02 BB97 511F BD54
_______________________________________________
[EMAIL PROTECTED]
http://www.freeamp.org/mailman/listinfo/freeamp-dev

Reply via email to