Remove strndup declaration as it is not used by scrollkeeper.

This commit is contained in:
Joe Marcus Clarke
2008-12-26 03:04:52 +00:00
parent 578fbaf4bb
commit 6cb3df0ae3

View File

@@ -1,25 +1,5 @@
--- libs/i18n.c.orig Sun Nov 9 18:05:36 2003
+++ libs/i18n.c Tue Feb 14 18:50:23 2006
@@ -38,6 +38,19 @@ enum {
* All rights reserved.
*/
+/* XXX Implement strndup for FreeBSD. */
+static char *
+strndup(const char *str, size_t len) {
+ char *ret;
+
+ if ((str == NULL || len < 0)) return(NULL);
+ ret = (char *)malloc(len + 1);
+ if (ret == NULL) return(NULL);
+ strncpy(ret, str, len);
+ ret[len] = '\0';
+ return(ret);
+}
+
/* Support function for compute_locale_variants. */
static int explode_locale(const char *locale, char **language,
char **territory, char **codeset, char **modifier)
@@ -118,7 +131,7 @@ static char **compute_locale_variants(co
if ((i & ~mask) == 0) {
int length = strlen(language) + strlen(territory)