On Thu, 2003-09-18 at 19:25, Tom Lane wrote:
> Oliver Elphick <olly@lfix.co.uk> writes:
> > Line 138 begins the definition of strndup(). However, strndup() is also
> > declared in string.h, which is included by this file. If I rename this
> > function to estrndup() (and also where it is called, further down) the
> > compilation succeeds.
>
> Hm, is strndup defined as a macro in your string.h? I suspect it's not
> a good idea to be providing a local definition of something that might
> be considered a standard function.
/* Return a malloc'd copy of at most N bytes of STRING. The resultant string is terminated even if no null terminator
appears before STRING[N]. */
#if defined __USE_GNU
extern char *strndup (__const char *__string, size_t __n) __THROW __attribute_malloc__;
#endif
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
======================================== "Give, and it shall be given unto you; good measure, pressed down, and
shakentogether, and running over, shall men pour into your lap. For by your standard of measure it will be
measuredto you in return." Luke 6:38