Subject RE: [ib-support] udf problem
Author Wilson, Fred
This certainly isn't a Firebird related question, so you should probably
post it to a 'C' list, but for a short answer;
- your function is defined as return a Char * and yet the function is
written to return a "short" -> short i .... return i


Best regards,
Fred Wilson
SE, Bell & Howell
fred.wilson@...


-----Original Message-----
From: jef.mony@... [mailto:jef.mony@...]
Sent: Thursday, July 11, 2002 7:56 AM
To: ib-support@yahoogroups.com
Subject: [ib-support] udf problem


Hi,
I try to make a udf in C (and I'm really not a good C programmer) , but I
have a problem when I built it :

char* EXPORT fn_kill_c (ARG(char*, s))
ARGLIST(char *s) /* VARCHAR input */
{
short i = 0;
short j = 0;
char *buffer1 = (char *)malloc(256);
char *buffer2 = (char *)malloc(256);

buffer1="/home/diren/temp/";

while (*s) /* copy the rest */
buffer2[j++] = *s++;

strcat (buffer1, buffer2);

i =unlink(buffer1);
return i;
}




gcc -c -O -fpic -fwritable-strings udflib.c

udflib.c: In function `fn_kill_c':
udflib.c:60: warning: return makes pointer from integer without a cast


If somebody have an idea, Thanks for it.


To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/