Hi Norbert, hi all,
> +#define TAIL_LEN(x) ((x)+strlen(x)), (BUFFERLEN-strlen(x))
OK, I recognize 'BUFFERLEN-strlen(x)' is always plus.
Even when buffer is full, strlen(x) become BUFFERLEN-1,
because buffer includes '\0'.
Sorry. Please forget my previous mail.
I'll attach my test source.
Hi Norbert, hi all,
-#define TAIL(x) (x+strlen(x))
+#define TAIL(x) ((x)+strlen(x))
It was my fault. Thank you for correcting.
+#define TAIL_LEN(x) ((x)+strlen(x)), (BUFFERLEN-strlen(x))
Nice idea.
I'm not sure but I'm wandering if snprintf()
can handle negative (minus) length or not.
Hi Karl, hi all,
On Sa, 07 Sep 2013, Karl Berry wrote:
> #define TAIL(x) (x+strlen(x))
Done, fixed patch attached: mendex-bugfix
> In general, shouldn't snprintf be used to avoid the whole potential of
> buffer overrun?
Done that for fwrite.c, but there are other cases in the source.
Patch
On Sa, 07 Sep 2013, Karl Berry wrote:
> As you know, it was part of the general Japanese-TeX import into TL, so
> I suppose you and Akira are :), with the rest of us chipping in as
> necessary.
>
> Please apply whatever patch you see fit.
Ok, will do that.
> #define TAIL(x) (x+strlen(x))
>
I am not sure who is currently maintaining mendex,
As you know, it was part of the general Japanese-TeX import into TL, so
I suppose you and Akira are :), with the rest of us chipping in as
necessary.
Please apply whatever patch you see fit.
#define TAIL(x) (x+strlen(x))
The first x o
Dear all,
I hope there is still someone listening.
Since quite some time there is a bug in mendex.
See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=534641
Easy to reproduce:
With the following idx file:
\indexentry{foo|(}{1}
\indexentry{foo|mac}{1}
\indexentry{foo|)}
6 matches
Mail list logo