]> git.cameronkatri.com Git - mandoc.git/blobdiff - xstd.c
Removed some unnecesary functions.
[mandoc.git] / xstd.c
diff --git a/xstd.c b/xstd.c
index 6442da41b4fd714d7c645b0abc880af5ea4891f8..8b2ec4e94e5c0fa3f1fb72d28e87f5570c7aae84 100644 (file)
--- a/xstd.c
+++ b/xstd.c
@@ -1,4 +1,4 @@
-/* $Id: xstd.c,v 1.5 2009/01/20 22:55:46 kristaps Exp $ */
+/* $Id: xstd.c,v 1.9 2009/03/08 19:47:41 kristaps Exp $ */
 /*
  * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
  *
@@ -34,13 +34,6 @@ extern       size_t           strlcpy(char *, const char *, size_t);
 #endif
 
 
-int
-xstrncmp(const char *p1, const char *p2, size_t sz)
-{
-
-       return(0 == strncmp(p1, p2, sz));
-}
-
 int
 xstrcmp(const char *p1, const char *p2)
 {
@@ -62,6 +55,16 @@ xstrlcpy(char *dst, const char *src, size_t sz)
        return(strlcpy(dst, src, sz) < sz);
 }
 
+void *
+xrealloc(void *ptr, size_t sz)
+{
+       void            *p;
+
+       if (NULL == (p = realloc(ptr, sz)))
+               err(EXIT_FAILURE, "realloc");
+       return(p);
+}
+
 void *
 xcalloc(size_t num, size_t sz)
 {
@@ -83,7 +86,7 @@ xstrdup(const char *p)
 }
 
 int
-xstrlcats(char *buf, const struct mdoc_node *n, size_t sz)
+xstrlcpys(char *buf, const struct mdoc_node *n, size_t sz)
 {
        char             *p;
 
@@ -93,7 +96,7 @@ xstrlcats(char *buf, const struct mdoc_node *n, size_t sz)
 
        for ( ; n; n = n->next) {
                assert(MDOC_TEXT == n->type);
-               p = n->data.text.string;
+               p = n->string;
                if ( ! xstrlcat(buf, p, sz))
                        return(0);
                if (n->next && ! xstrlcat(buf, " ", sz))