diff --git a/lib/libqof/backend/file/qsf-backend.c b/lib/libqof/backend/file/qsf-backend.c index 7de96b7804..40d97a02f6 100644 --- a/lib/libqof/backend/file/qsf-backend.c +++ b/lib/libqof/backend/file/qsf-backend.c @@ -188,10 +188,10 @@ qsf_param_init(qsf_param *params) qsf_time_now_t = time(NULL); qsf_ts = g_new(Timespec, 1); timespecFromTime_t(qsf_ts, qsf_time_now_t); - strftime(qsf_enquiry_date, QSF_DATE_LENGTH, QSF_XSD_TIME, gmtime(&qsf_time_now_t)); - strftime(qsf_time_match, QSF_DATE_LENGTH, qsf_time_precision, gmtime(&qsf_time_now_t)); - strftime(qsf_time_string, QSF_DATE_LENGTH, "%F", gmtime(&qsf_time_now_t)); - strftime(qsf_time_now, QSF_DATE_LENGTH, QSF_XSD_TIME, gmtime(&qsf_time_now_t)); + qof_strftime(qsf_enquiry_date, QSF_DATE_LENGTH, QSF_XSD_TIME, gmtime(&qsf_time_now_t)); + qof_strftime(qsf_time_match, QSF_DATE_LENGTH, qsf_time_precision, gmtime(&qsf_time_now_t)); + qof_strftime(qsf_time_string, QSF_DATE_LENGTH, "%F", gmtime(&qsf_time_now_t)); + qof_strftime(qsf_time_now, QSF_DATE_LENGTH, QSF_XSD_TIME, gmtime(&qsf_time_now_t)); g_hash_table_insert(params->qsf_default_hash, "qsf_enquiry_date", qsf_enquiry_date); g_hash_table_insert(params->qsf_default_hash, "qsf_time_now", &qsf_time_now_t); g_hash_table_insert(params->qsf_default_hash, "qsf_time_string", qsf_time_string); diff --git a/lib/libqof/backend/file/qsf-xml-map.c b/lib/libqof/backend/file/qsf-xml-map.c index 1e8c809594..84aeb7b653 100644 --- a/lib/libqof/backend/file/qsf-xml-map.c +++ b/lib/libqof/backend/file/qsf-xml-map.c @@ -52,7 +52,7 @@ qsf_date_default_handler(const gchar *default_name, GHashTable *qsf_default_hash xmlNewProp(output_parent, BAD_CAST QSF_OBJECT_TYPE, xmlGetProp(import_node, BAD_CAST MAP_VALUE_ATTR)); qsf_time = (time_t*)g_hash_table_lookup(qsf_default_hash, default_name); - strftime(date_as_string, QSF_DATE_LENGTH, QSF_XSD_TIME, gmtime(qsf_time)); + qof_strftime(date_as_string, QSF_DATE_LENGTH, QSF_XSD_TIME, gmtime(qsf_time)); xmlNodeAddContent(output_parent, BAD_CAST date_as_string); } @@ -569,7 +569,7 @@ qsf_set_format_value(xmlChar *format, gchar *qsf_time_now_as_string, regfree(®); /** QSF_DATE_LENGTH preset for all internal and QSF_XSD_TIME string formats. */ - strftime(qsf_time_now_as_string, QSF_DATE_LENGTH, (char*)format, gmtime(output)); + qof_strftime(qsf_time_now_as_string, QSF_DATE_LENGTH, (char*)format, gmtime(output)); LEAVE (" ok"); } diff --git a/lib/libqof/qof/qofbookmerge.c b/lib/libqof/qof/qofbookmerge.c index b7ecfb966f..fc68ffa35b 100644 --- a/lib/libqof/qof/qofbookmerge.c +++ b/lib/libqof/qof/qofbookmerge.c @@ -845,7 +845,7 @@ qof_book_merge_param_as_string(QofParam *qtparam, QofEntity *qtEnt) date_getter = (Timespec (*)(QofEntity*, QofParam*))qtparam->param_getfcn; param_ts = date_getter(qtEnt, qtparam); param_t = timespecToTime_t(param_ts); - strftime(param_date, QOF_DATE_STRING_LENGTH, QOF_UTC_DATE_FORMAT, gmtime(¶m_t)); + qof_strftime(param_date, QOF_DATE_STRING_LENGTH, QOF_UTC_DATE_FORMAT, gmtime(¶m_t)); param_string = g_strdup(param_date); return param_string; } diff --git a/lib/libqof/qof/qoflog.c b/lib/libqof/qof/qoflog.c index f929c2a8de..986dc964e5 100644 --- a/lib/libqof/qof/qoflog.c +++ b/lib/libqof/qof/qoflog.c @@ -103,7 +103,7 @@ log4glib_handler(const gchar *log_domain, gchar *level_str = qof_log_level_to_string(log_level); now = time(NULL); localtime_r(&now, &now_tm); - strftime(timestamp_buf, 9, "%T", &now_tm); + qof_strftime(timestamp_buf, 9, "%T", &now_tm); fprintf(fout, "* %s %*s <%s> %*s%s%s", timestamp_buf, diff --git a/lib/libqof/qof/qofutil.c b/lib/libqof/qof/qofutil.c index 6e678e8326..e8d6501219 100644 --- a/lib/libqof/qof/qofutil.c +++ b/lib/libqof/qof/qofutil.c @@ -426,7 +426,7 @@ qof_util_param_as_string(QofEntity *ent, QofParam *param) date_getter = (Timespec (*)(QofEntity*, QofParam*))param->param_getfcn; param_ts = date_getter(ent, param); param_t = timespecToTime_t(param_ts); - strftime(param_date, MAX_DATE_LENGTH, + qof_strftime(param_date, MAX_DATE_LENGTH, QOF_UTC_DATE_FORMAT, gmtime(¶m_t)); param_string = g_strdup(param_date); known_type = TRUE; diff --git a/src/backend/file/sixtp-utils.c b/src/backend/file/sixtp-utils.c index 4bdd7103b4..959b55240d 100644 --- a/src/backend/file/sixtp-utils.c +++ b/src/backend/file/sixtp-utils.c @@ -531,8 +531,8 @@ timespec_secs_to_given_string (const Timespec *ts, gchar *str) if (!localtime_r(&tmp_time, &parsed_time)) return FALSE; - num_chars = strftime(str, TIMESPEC_SEC_FORMAT_MAX, - TIMESPEC_TIME_FORMAT, &parsed_time); + num_chars = qof_strftime(str, TIMESPEC_SEC_FORMAT_MAX, + TIMESPEC_TIME_FORMAT, &parsed_time); if (num_chars == 0) return FALSE; diff --git a/src/business/business-ledger/gncEntryLedgerModel.c b/src/business/business-ledger/gncEntryLedgerModel.c index 1c4a720c0e..abeb84c54c 100644 --- a/src/business/business-ledger/gncEntryLedgerModel.c +++ b/src/business/business-ledger/gncEntryLedgerModel.c @@ -562,7 +562,7 @@ static char * get_date_help (VirtualLocation virt_loc, gpointer user_data) gnc_date_cell_get_date ((DateCell *) cell, &ts); tt = ts.tv_sec; tm = localtime (&tt); - strftime (string, sizeof(string), "%A %d %B %Y", tm); + qof_strftime (string, sizeof(string), "%A %d %B %Y", tm); return g_strdup (string); } diff --git a/src/calculation/amort_opt.c b/src/calculation/amort_opt.c index cbed16e662..1eb8e7be29 100644 --- a/src/calculation/amort_opt.c +++ b/src/calculation/amort_opt.c @@ -60,9 +60,9 @@ void *parse_env) times_I->tm_yday = amortsched->yday_I; printf("\n******************************"); - strftime(buffer,(size_t)50,"%c",times_E); + qof_strftime(buffer,(size_t)50,"%c",times_E); printf("\nEffective Date: %s\n",buffer); - strftime(buffer,(size_t)50,"%c",times_I); + qof_strftime(buffer,(size_t)50,"%c",times_I); printf("Initial Payment Date: %s\n",buffer); free(times_E); free(times_I); diff --git a/src/calculation/amort_prt.c b/src/calculation/amort_prt.c index 5536cb2a91..a1933ceb0f 100644 --- a/src/calculation/amort_prt.c +++ b/src/calculation/amort_prt.c @@ -65,9 +65,9 @@ FILE *ofile) /* output file */ times_I->tm_yday = amortsched->yday_I; fprintf(ofile,"Amortization Table\n"); - strftime(datel,(size_t)100,"%c",times_E); + qof_strftime(datel,(size_t)100,"%c",times_E); fprintf(ofile,"Effective Date: %s\n",datel); - strftime(datel,(size_t)100,"%c",times_I); + qof_strftime(datel,(size_t)100,"%c",times_I); fprintf(ofile,"Initial Payment Date: %s\n",datel); fprintf(ofile,"Compounding Frequency per year: %u\n",amortsched->CF); fprintf(ofile,"Payment Frequency per year: %u\n",amortsched->PF); diff --git a/src/engine/FreqSpec.c b/src/engine/FreqSpec.c index aea2cd5a9a..56cf13299b 100644 --- a/src/engine/FreqSpec.c +++ b/src/engine/FreqSpec.c @@ -131,7 +131,7 @@ get_wday_name(guint day) struct tm t; memset( &t, 0, sizeof( t ) ); t.tm_wday = day; - strftime(wday_name, WDAY_NAME_WIDTH, "%A", &t); + qof_strftime(wday_name, WDAY_NAME_WIDTH, "%A", &t); return wday_name; } @@ -142,7 +142,7 @@ get_full_month_name(guint month) static gchar month_name[WDAY_BUF_WIDTH]; struct tm t; t.tm_mon = month; - strftime(month_name, WDAY_NAME_WIDTH, "%B", &t); + qof_strftime(month_name, WDAY_NAME_WIDTH, "%B", &t); return month_name; } #endif @@ -154,7 +154,7 @@ get_abbrev_month_name(guint month) struct tm t; memset( &t, 0, sizeof( t ) ); t.tm_mon = month; - strftime(month_name, WDAY_NAME_WIDTH, "%b", &t); + qof_strftime(month_name, WDAY_NAME_WIDTH, "%b", &t); return month_name; } diff --git a/src/engine/Recurrence.c b/src/engine/Recurrence.c index 1a0f56c973..1758a05214 100644 --- a/src/engine/Recurrence.c +++ b/src/engine/Recurrence.c @@ -407,7 +407,7 @@ _dow_abbrev(gchar *buf, int buf_len, int dow) memset(buf, 0, buf_len); memset(&my_tm, 0, sizeof(struct tm)); my_tm.tm_wday = dow; - i = strftime(buf, buf_len - 1, "%a", &my_tm); + i = qof_strftime(buf, buf_len - 1, "%a", &my_tm); buf[i] = 0; } diff --git a/src/gnome-utils/gnc-date-edit.c b/src/gnome-utils/gnc-date-edit.c index a5c63bf8ad..473c03a5c6 100644 --- a/src/gnome-utils/gnc-date-edit.c +++ b/src/gnome-utils/gnc-date-edit.c @@ -331,9 +331,9 @@ fill_time_popup (GtkWidget *widget, GNCDateEdit *gde) hit = g_new (hour_info_t, 1); if (gde->flags & GNC_DATE_EDIT_24_HR) - strftime (buffer, sizeof (buffer), "%H:00", mtm); + qof_strftime (buffer, sizeof (buffer), "%H:00", mtm); else - strftime (buffer, sizeof (buffer), "%I:00 %p ", mtm); + qof_strftime (buffer, sizeof (buffer), "%I:00 %p ", mtm); hit->hour = g_strdup (buffer); hit->gde = gde; @@ -355,11 +355,11 @@ fill_time_popup (GtkWidget *widget, GNCDateEdit *gde) mtm->tm_min = j; hit = g_new (hour_info_t, 1); if (gde->flags & GNC_DATE_EDIT_24_HR) - strftime (buffer, sizeof (buffer), - "%H:%M", mtm); + qof_strftime (buffer, sizeof (buffer), + "%H:%M", mtm); else - strftime (buffer, sizeof (buffer), - "%I:%M %p", mtm); + qof_strftime (buffer, sizeof (buffer), + "%I:%M %p", mtm); hit->hour = g_strdup (buffer); hit->gde = gde; @@ -505,9 +505,9 @@ gnc_date_edit_set_time_tm (GNCDateEdit *gde, struct tm *mytm) /* Set the time */ if (gde->flags & GNC_DATE_EDIT_24_HR) - strftime (buffer, sizeof (buffer), "%H:%M", mytm); + qof_strftime (buffer, sizeof (buffer), "%H:%M", mytm); else - strftime (buffer, sizeof (buffer), "%I:%M %p", mytm); + qof_strftime (buffer, sizeof (buffer), "%I:%M %p", mytm); gtk_entry_set_text (GTK_ENTRY (gde->time_entry), buffer); } diff --git a/src/gnome-utils/gnc-date-format.c b/src/gnome-utils/gnc-date-format.c index 5e2a02e579..d8f90e5e9d 100644 --- a/src/gnome-utils/gnc-date-format.c +++ b/src/gnome-utils/gnc-date-format.c @@ -514,7 +514,7 @@ gnc_date_format_refresh (GNCDateFormat *gdf) /* Visual feedback on what the date will look like. */ secs_now = time(NULL); localtime_r(&secs_now, &today); - strftime(date_string, MAX_DATE_LEN, format, &today); + qof_strftime(date_string, MAX_DATE_LEN, format, &today); gtk_label_set_text(GTK_LABEL(priv->sample_label), date_string); g_free(format); } diff --git a/src/gnome-utils/gnc-dense-cal.c b/src/gnome-utils/gnc-dense-cal.c index 36eb32e988..03cb61fbb4 100644 --- a/src/gnome-utils/gnc-dense-cal.c +++ b/src/gnome-utils/gnc-dense-cal.c @@ -176,7 +176,7 @@ static const gchar *day_label(int wday) memset(buf, 0, MONTH_NAME_BUFSIZE); memset(&my_tm, 0, sizeof(struct tm)); my_tm.tm_wday = wday; - i = strftime (buf, MONTH_NAME_BUFSIZE-1, "%a", &my_tm); + i = qof_strftime (buf, MONTH_NAME_BUFSIZE-1, "%a", &my_tm); /* Wild hack to use only the first two letters */ buf[2]='\0'; return buf; diff --git a/src/import-export/import-backend.c b/src/import-export/import-backend.c index 51ed29a29f..9cde7dbd7e 100644 --- a/src/import-export/import-backend.c +++ b/src/import-export/import-backend.c @@ -415,7 +415,7 @@ TransactionGetTokens(GNCImportTransInfo *info) */ transtime = xaccTransGetDate(transaction); tm_struct = gmtime(&transtime); - if(!strftime(local_day_of_week, sizeof(local_day_of_week), "%A", tm_struct)) + if(!qof_strftime(local_day_of_week, sizeof(local_day_of_week), "%A", tm_struct)) { PERR("TransactionGetTokens: error, strftime failed\n"); } diff --git a/src/register/ledger-core/split-register-model.c b/src/register/ledger-core/split-register-model.c index 5630c90cbd..5cc3e9fd15 100644 --- a/src/register/ledger-core/split-register-model.c +++ b/src/register/ledger-core/split-register-model.c @@ -789,7 +789,7 @@ gnc_split_register_get_date_help (VirtualLocation virt_loc, tm = localtime (&tt); - strftime (string, sizeof (string), "%A %d %B %Y", tm); + qof_strftime (string, sizeof (string), "%A %d %B %Y", tm); return g_strdup (string); }