static pthread_mutex_t strerror_r_lock = PTHREAD_MUTEX_INITIALIZER;
#endif
-void sstrncpy (char *d, const char *s, int len)
+char *sstrncpy (char *dest, const char *src, size_t n)
{
- strncpy (d, s, len);
- d[len - 1] = '\0';
-}
+ strncpy (dest, src, n);
+ dest[n - 1] = '\0';
+
+ return (dest);
+} /* char *sstrncpy */
char *sstrdup (const char *s)
{
#define STATIC_ARRAY_SIZE(a) (sizeof (a) / sizeof (*(a)))
-void sstrncpy(char *d, const char *s, int len);
+char *sstrncpy (char *dest, const char *src, size_t n);
char *sstrdup(const char *s);
void *smalloc(size_t size);
char *sstrerror (int errnum, char *buf, size_t buflen);