[BACK]Return to xstd.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/Attic/xstd.c between version 1.2 and 1.3

version 1.2, 2008/12/29 18:08:44 version 1.3, 2009/01/17 16:15:27
Line 16 
Line 16 
  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR   * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  * PERFORMANCE OF THIS SOFTWARE.   * PERFORMANCE OF THIS SOFTWARE.
  */   */
   #include <assert.h>
 #include <err.h>  #include <err.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
Line 73  xstrdup(const char *p)
Line 74  xstrdup(const char *p)
                 err(EXIT_FAILURE, "strdup");                  err(EXIT_FAILURE, "strdup");
         return(pp);          return(pp);
 }  }
   
   
   int
   xstrlcats(char *buf, const struct mdoc_node *n, size_t sz)
   {
           char             *p;
   
           assert(sz > 0);
           assert(buf);
           *buf = 0;
   
           for ( ; n; n = n->next) {
                   assert(MDOC_TEXT == n->type);
                   p = n->data.text.string;
                   if ( ! xstrlcat(buf, p, sz))
                           return(0);
                   if (n->next && ! xstrlcat(buf, " ", sz))
                           return(0);
           }
   
           return(1);
   }
   
   
   
   
 #ifdef __linux__  #ifdef __linux__

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

CVSweb