-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Bruno Haible on 5/9/2008 5:50 PM: | Going a bit farther than Eric's xmemdup0 function, I would like to propose | a module 'xstring' with an <xstring.h> header file that defines the following | functions: | | /* Return a substring of the given string, len bytes long starting at str. */ | char * xsubstring (const char *str, size_t len);
How is this different from [x]strndup? At least strndup is standardized. | | /* Duplicate a string. Moved here from xalloc.h. Keeps being declared in | xalloc.h for a transition period, with a warning if it's used from there | (a migration aid). */ | char * xstrdup (const char *string); | | | Comments? Additions? The remaining functions looked reasonable from a first glance. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgk7vcACgkQ84KuGfSFAYC8kQCdGi7HNyJKcP76fW5+wh2jAyLl rggAoJ8Vhj6RLAmkPeMYTMSx6XTCq2SA =TSV2 -----END PGP SIGNATURE-----
