Re: XForms: problems with fl_get_choice_text

Bjoern Fuerst (
Fri, 07 Nov 1997 10:21:45 +0100 (CET)

To subscribers of the xforms list from Bjoern Fuerst <> :

On 06-Nov-97 Steve Lamont wrote:
>To subscribers of the xforms list from (Steve Lamont) :

sscanf((char *)datum(),"%*s %s %d %s %d",monat,&tag,time_string,&jahr);

>Is the pointer `time_string' initialized? If not, you're going to be
>writing into who knows where. sscanf() does not do any memory
>allocation, it simply returns data to where ever it thinks it's told
>to write. If `time_string' isn't initialized, then it will have
>whatever value just happens to be on the stack in that slot.
>You should change your code to read
> char *time_string;
> [...]
> time_string = ( char *) malloc( TIME_STRING_SIZE );
> [...]
> sscanf( ... );
>where TIME_STRING_SIZE is whatever size is appropriate -- maybe 9?

You are right Steve. Sorry I forgot to write it in the mail (it's my first maili
ng list, but I hope I'm improving).

It is initialized via:

time_string=(char *)malloc(sizeof(char)*10);


To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: