2 * zebra string function
4 * these functions are just very basic wrappers around exiting ones and
5 * do not offer the protection that might be expected against buffer
15 * snprint() is a real basic wrapper around the standard sprintf()
16 * without any bounds checking
19 snprintf(char *str
, size_t size
, const char *format
, ...)
23 va_start (args
, format
);
25 return vsprintf (str
, format
, args
);
31 * strlcpy is a safer version of strncpy(), checking the total
35 strlcpy(char *dst
, const char *src
, size_t size
)
37 strncpy(dst
, src
, size
);
45 * strlcat is a safer version of strncat(), checking the total
49 strlcat(char *dst
, const char *src
, size_t size
)
51 /* strncpy(dst, src, size - strlen(dst)); */
53 /* I've just added below code only for workable under Linux. So
54 need rewrite -- Kunihiro. */
55 if (strlen (dst
) + strlen (src
) >= size
)