Hello,
>
> extern "C" __declspec(dllexport) char *echo(UDF_INIT *initid, UDF_ARGS *args, char
> *is_null, char *error)
> {
> return args->args[0];
> }
>
args->args[0] is not null terminated. This is how I've been handling
this. please let me know if there is a better approach (i.e. whether it
is possible, for example, to terminate args->args[0] 'in place', my
guess is not)
char buff[255];
int arglen = args->lengths[0] < 255 ? args->lengths[0] : 255;
strncpy(buff,args->args[0],arglen);
buff[arglen] = 0;
etc.
of course, you can't return a pointer to buff in this case. if you want
to return the argument you will have to allocate memory in _init and
pass it along in initid->ptr which then could used instead of buff etc.
cheers,
--
Murad Nayal M.D. Ph.D.
Department of Biochemistry and Molecular Biophysics
College of Physicians and Surgeons of Columbia University
630 West 168th Street. New York, NY 10032
Tel: 212-305-6884 Fax: 212-305-6926
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]