List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:January 18 2001 11:10pm
Subject:Exception in fn_format
View as plain text  
Hi!

>>>>> "Philippe" == Philippe MORIN <pmorin@stripped>
> writes:

Philippe> Hi
Philippe> I think that MySql may be more stable if we add the line "*pos = 0;" just
> behind "pos=strnmov(strmov(to,dev),name,length);" in fn_format function, in
> mysys/mf_format.c file, like that :

Philippe>     pos=strnmov(strmov(to,dev),name,length);
Philippe>     *pos = 0;
Philippe> #ifdef FN_UPPER_CASE
Philippe>     caseup_str(to);
Philippe> #endif
Philippe> #ifdef FN_LOWER_CASE
Philippe>     casedn_str(to);
Philippe> #endif
Philippe>     (void) strmov(pos,ext);   /* Don't convert extension */

Philippe> Because sometimes, in debug mode (with version number 3.23.29a-gamma-win), I
> have an exception during opening of a database, in casedn_str function, if there isn't any
> '\0' in the string (because strnmov don't add '\0' if the length of the string to copy is
> bigger than length parameter).

Philippe> Regards

You are right.

Anyway, the right call to do is strmake() instead of strnmove, as this
is exactly like strnmov, but adding the last 0.

I will fix that at once!

Regards,
Monty
Thread
Exception in fn_formatPhilippe MORIN18 Jan
  • Exception in fn_formatMichael Widenius18 Jan