Mladen Turk wrote:
Mladen Turk wrote:
Rainer Jung wrote:
But I'm open. If we remove the const, we also need to remove it for
the log_fmt (got as compiler warning also there, but don't have the
line number at hand).
Which would you prefer? Do you see a problem with the const, like
wrong compiler optimization or so?
Yes, that's a problem. Something const should never be fed to a free.
I don't see a problem if we have an char[] for each of them and
simply do a strncpy instead having duality for the same thing.
The other solution is to have a char* and always call free.
When we need to assign const char* we call strdup("foo")
Regards,
Mladen
OK, I use a const char* for log_fmt, because I can take that one simply
from Apache, and a char[] of fixed max size for log_fmt_subsec, because
we need to make changes to that one. Now the code doesn't do any more
malloc(), because I can copy directly to the char[], so the free() is
gone to.
Have a look, if you find the latest commit understandable.
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]