Re: Problem in the foobar widget.

On Tue, Sep 19, 2000 at 05:12:09PM -0400, Matthew Berg wrote:
> There is a bug in gnome-core 1.2.1, in panel/foobar-widget.c. 
> The problem is that the return on strftime isn't being checked properly,
> resulting in an undefined string being assigned to hour, e.g.

This is fixed in HEAD and in the 1.2.2 that's coming soon (hopefully).  The
way it now works is:

  char hour[256];

  if(strftime(hour, sizeof(hour), _("%A %B %d"), das_tm) == 0) {
  	/* according to docs, if the string does not fit, the
   	* contents of tmp2 are undefined, thus just use
   	* ??? */
  	strcpy(hour, "???");
  hour[sizeof(hour)-1] = '\0'; /* just for sanity */

This will work even with broken strftime which does return max, though you
may get weird things (but no crash).

Thanks for the report though


George <jirka 5z com>
   History teaches us that men and nations behave wisely
   once they have exhausted all other alternatives.
                       -- Abba Eban, 1970

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]