Re: [evolution-patches] Re: 43485: strftime usage in e-cell-date
- From: Ettore Perazzoli <ettore ximian com>
- To: Mike Kestner <mkestner ximian com>
- Cc: Jeffrey Stedfast <fejj ximian com>, patches <evolution-patches ximian com>
- Subject: Re: [evolution-patches] Re: 43485: strftime usage in e-cell-date
- Date: 28 May 2003 17:23:21 -0400
Looks good.
On Tue, 2003-05-27 at 12:30, Mike Kestner wrote:
> On Fri, 2003-05-23 at 16:25, Jeffrey Stedfast wrote:
> > probably better to use memcpy, especially since s and buf do not
> > overlap.
> >
> > also:
> >
> > sz = MIN (sz, max - 1);
> > memcpy (s, buf, sz);
> > s[sz] = '\0';
>
> I know we went off on a tangent looking for the beautiful solution
> returning dynamically allocated strings, but in the interest of thinking
> small in RC mode I've updated the previous patch to address Jeff's
> feedback. This patch uses memcpy and also uses g_utf8_find_prev_char to
> truncate to a string that will fit in the buffer provided.
>
> Maybe this is still wrong though, since the strftime behavior would be
> to return 0 and an undefined buffer if the utf8 converted text doesn't
> fit in the buffer. So, I can either commit this patch or one altered to
> just return 0 in the sz >= max case.
>
> Mike
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]