Just a sample of the Echomail archive
[ << oldest | < older | list | newer > | newest >> ]
|  Message 919  |
|  Wilfred van Velzen to Developers  |
|  Code change suggestions  |
|  13 Feb 14 16:29:02  |
 
Hi Developers,
I want to suggest the following changes to the makenl code:
diff --git a/src/lsttool.c b/src/lsttool.c
index 467905f..3142a8b 100644
-+- a/src/lsttool.c
+++ b/src/lsttool.c
@@ -41,7 +41,7 @@ int makearc(char *filename, int move)
char name[MYMAXFILE];
char fullpath[MYMAXPATH];
char cmdlinebuf[MYMAXPATH];
- char arccommand[ARCCMDMAX];
+ char *arccommand;
if (os_filesize(filename) <= ARCThreshold || ARCThreshold == -1)
{
@@ -54,12 +54,12 @@ int makearc(char *filename, int move)
if (toupper((int) ext[0]) == 'D') /* Autogenerated diff - can
always be moved */
{
ext[1] = 'd';
- strlcpy(arccommand, ArcMoveCmd, sizeof arccommand); /* move instead
of add */
+ arccommand = ArcMoveCmd; /* move instead of add */
ext[0] = ArcMoveExt[0];
}
else
{
- strlcpy(arccommand, (move < 1) ? ArcCopyCmd : ArcMoveCmd, sizeof
arccommand);
+ arccommand = (move < 1) ? ArcCopyCmd : ArcMoveCmd;
ext[0] = (move < 1) ? ArcCopyExt[0] : ArcMoveExt[0];
}
myfnmerge(fullpath, NULL, OutDir, name, ext);
diff --git a/src/makenl.h b/src/makenl.h
index e78b804..888e65e 100644
-+- a/src/makenl.h
+++ b/src/makenl.h
@@ -18,7 +18,7 @@ extern int JustTest;
extern int debug_mode;
#define linelength 512
-#define ARCCMDMAX 20
+#define ARCCMDMAX 256
#define ARCEXTMAX 4
#define ARCUNPMAX 10
I was hit by the (undocumented) arcopy and arcmove command line limit of 20
chars when I upgraded from 3.2.9b to 3.4.2.
The configuration lines I use are:
arccopy l /usr/local/bin/lha cqi
arcmove l /usr/local/bin/lha cqi
Which needs a command line buffer of at least 23 chars.
Because in the 3.4.2 version (or a version inbetween) fixes a bug where the
command line length wasn't checked when it copied the string from the
configuration file, it used to work with the 3.2.9b version. But no longer in
the 3.4.2, so I got an error when the arccopy command was executed by makenl
in my configuration, because the command line was cut short...
256 is still arbitrary, but should be enough for most systems. ;)
Bye, Wilfred.
--- FMail-W32-1.67.0.46-B20140112
* Origin: Amiga Offline BBS Lisse (2:280/464)
|
[ << oldest | < older | list | newer > | newest >> ]