! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
orage does not start: orage_tm_date_to_i18_date too long string in strftime
Status:
CLOSED: FIXED

Comments

Description Partha Pratim Ghosh 2013-08-31 22:20:00 CEST
I have installed Debian Wheezy and my locale is Bengali; the output from locale is:

LANG=bn_IN
LANGUAGE=
LC_CTYPE="bn_IN"
LC_NUMERIC="bn_IN"
LC_TIME="bn_IN"
LC_COLLATE="bn_IN"
LC_MONETARY="bn_IN"
LC_MESSAGES="bn_IN"
LC_PAPER="bn_IN"
LC_NAME="bn_IN"
LC_ADDRESS="bn_IN"
LC_TELEPHONE="bn_IN"
LC_MEASUREMENT="bn_IN"
LC_IDENTIFICATION="bn_IN"
LC_ALL=

Nothing happens on clicking on orage calendar under office.

Issuing orage on the command line issues the following message:

** Message: First Orage start. Searching default timezone.
** Message: Default timezone set to Asia/Kolkata.

** (orage:6537): ERROR **: Orage: orage_tm_date_to_i18_date too long string in strftime
Trace/breakpoint trap


Please help me to solve this problem.
Comment 1 juha editbugs 2013-09-01 08:57:22 CEST
If you have the source code and can build Orage, you need to change:
1) functions.c
FROM:
char *orage_tm_time_to_i18_time(struct tm *tm_time)
{
    static char i18_time[32];

    if (strftime(i18_time, 32, "%x %R", tm_time) == 0)
        g_error("Orage: orage_tm_time_to_i18_time too long string in strftime");
    return(i18_time);
}

char *orage_tm_date_to_i18_date(struct tm *tm_date)
{
    static char i18_date[32];

    if (strftime(i18_date, 32, "%x", tm_date) == 0)
        g_error("Orage: orage_tm_date_to_i18_date too long string in strftime");
    return(i18_date);
}

TO:
char *orage_tm_time_to_i18_time(struct tm *tm_time)
{
    static char i18_time[128];

    if (strftime(i18_time, 128, "%x %R", tm_time) == 0)
        g_error("Orage: orage_tm_time_to_i18_time too long string in strftime");
    return(i18_time);
}

char *orage_tm_date_to_i18_date(struct tm *tm_date)
{
    static char i18_date[128];

    if (strftime(i18_date, 128, "%x", tm_date) == 0)
        g_error("Orage: orage_tm_date_to_i18_date too long string in strftime");
    return(i18_date);
}

and in 
tray_icon.c
FROM:
static gboolean format_line(PangoLayout *pl, struct tm *t, char *data
        , char *font, char *color)
{
    gchar ts[200];
    gchar row[20];
    gchar *row_format = "<span foreground=\"%s\" font_desc=\"%s\">%s</span>";
    gchar *strftime_failed = "format_line: strftime %s failed";

    if (ORAGE_STR_EXISTS(data)) {
        if (strftime(row, 19, data, t) == 0) {
            g_warning(strftime_failed, data);
            return(FALSE);
        }
 
TO:
static gboolean format_line(PangoLayout *pl, struct tm *t, char *data
        , char *font, char *color)
{
    gchar ts[200];
    gchar row[90];
    gchar *row_format = "<span foreground=\"%s\" font_desc=\"%s\">%s</span>";
    gchar *strftime_failed = "format_line: strftime %s failed";

    if (ORAGE_STR_EXISTS(data)) {
        if (strftime(row, 89, data, t) == 0) {
            g_warning(strftime_failed, data);
            return(FALSE);
        }




the bug is too short temporary conversion string buffers.
I will fix this in some version.
Comment 2 juha editbugs 2013-11-04 13:56:58 CET
Fixed in 4.6.9.2.
Comment 3 juha editbugs 2013-12-11 08:07:02 CET
Fixed in 4.10.0

Bug #10325

Reported by:
Partha Pratim Ghosh
Reported on: 2013-08-31
Last modified on: 2013-12-11

People

CC List:
0 users

Version

Attachments

Additional information