bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] xalloc: add xstrndup


From: Bruno Haible
Subject: Re: [Bug-gnulib] xalloc: add xstrndup
Date: Fri, 15 Aug 2003 13:39:23 +0200
User-agent: KMail/1.5

Simon Josefsson wrote:
> I find xalloc useful, but missed a xstrndup.

> 2003-08-15  Simon Josefsson  <address@hidden>
>
>       * modules/xalloc: Add xstrndup.c.

I'd much prefer a separate module 'xstrndup', because
  1. Not everyone who needs xmalloc needs xstrndup (in particular
     gettext doesn't need it),
  2. xalloc is a general purpose memory allocation facility, whereas
     xstrndup is a string processing facility (extracting a substring
     of a string, starting at 0).

> 2003-08-15  Simon Josefsson  <address@hidden>
>
>       * xstrndup.c: New file.

Instead of rolling an implementation with a FIXME, why don't you take
the implementation from Bison?

Also, a xstrndup.h file is missing. We no longer want functions that
are not declared in .h files! lib/system.h is dead.

In MODULES.html.sh, the xstrndup module would belong in section
  Extra functions based on ANSI C 89
    String handling <string.h>

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]