[Pkg-dspam-misc] Patch to include a directory with files with parameters.

José Luis Tallón jltallon at adv-solutions.net
Thu Nov 10 01:32:50 UTC 2005


Matthijs Mohlmann wrote:

>Hi,
>
>I managed to fix it. Please review the attached patch. And after a few
>hours I'll upload it to the svn repository.
>
>[snip]
>  
>
Looks allright, except that you really don't check the error to see if
it really was a file which we tried to open as opposed to a dir.

Regarding the final '\n', i suggest this instead:
---
// look for a linefeed at the end...
char* ptr=strrchr(path,'\n');
// ... and nuke it if found
if( ptr )*ptr='\0';

--------
then you can avoid unconditionally using "strlen(path)-1" everywhere.
strncpy is good :-)
Looks fine -- sorry, don't have the time to test it right now.


Thank you.

    J.L.




More information about the Pkg-dspam-misc mailing list