version 1.55, 2009/03/21 21:09:00 |
version 1.56, 2009/03/23 14:22:11 |
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <string.h> |
#include <string.h> |
|
|
#include "private.h" |
#include "libmdoc.h" |
|
|
/* |
/* |
* Routines to parse arguments of macros. Arguments follow the syntax |
* Routines to parse arguments of macros. Arguments follow the syntax |
Line 294 mdoc_argv(struct mdoc *mdoc, int line, int tok, |
|
Line 294 mdoc_argv(struct mdoc *mdoc, int line, int tok, |
|
return(ARGV_ERROR); |
return(ARGV_ERROR); |
|
|
if (NULL == (arg = *v)) { |
if (NULL == (arg = *v)) { |
*v = xcalloc(1, sizeof(struct mdoc_arg)); |
if (NULL == (*v = calloc(1, sizeof(struct mdoc_arg)))) |
|
err(1, "calloc"); |
arg = *v; |
arg = *v; |
} |
} |
|
|
Line 792 argv_opt_single(struct mdoc *mdoc, int line, |
|
Line 793 argv_opt_single(struct mdoc *mdoc, int line, |
|
return(1); |
return(1); |
|
|
v->sz = 1; |
v->sz = 1; |
v->value = xcalloc(1, sizeof(char *)); |
if (NULL == (v->value = calloc(1, sizeof(char *)))) |
v->value[0] = xstrdup(p); |
err(1, "calloc"); |
|
if (NULL == (v->value[0] = strdup(p))) |
|
err(1, "strdup"); |
return(1); |
return(1); |
} |
} |
|
|
Line 817 argv_single(struct mdoc *mdoc, int line, |
|
Line 820 argv_single(struct mdoc *mdoc, int line, |
|
return(perr(mdoc, line, ppos, EARGVAL)); |
return(perr(mdoc, line, ppos, EARGVAL)); |
|
|
v->sz = 1; |
v->sz = 1; |
v->value = xcalloc(1, sizeof(char *)); |
if (NULL == (v->value = calloc(1, sizeof(char *)))) |
v->value[0] = xstrdup(p); |
err(1, "calloc"); |
|
if (NULL == (v->value[0] = strdup(p))) |
|
err(1, "strdup"); |
return(1); |
return(1); |
} |
} |
|
|