* lib/parameter.c:
* support/popt.c: (poptGetContext): Cleaned.
* support/vsnprintf.c: s/strncpy/g_strlcpy
svn path=/trunk/; revision=3449
poptContext poptGetContext(const char * name, int argc, const char ** argv,
const struct poptOption * options, int flags) {
- poptContext con = malloc(sizeof(*con));
-
- memset(con, 0, sizeof(*con));
+ poptContext con = calloc(1, sizeof *con);
con->os = con->optionStack;
con->os->argc = argc;
size_t n;
char *p;
{
- strncpy(str, p, n-1);
- str[n-1] = '\0';
+ g_strlcpy(str, p, n);
if (mprotect((caddr_t)(p + n + EXTRABYTES), pgsize,
PROT_READ|PROT_WRITE|PROT_EXEC) == -1)
mprotect((caddr_t)(p + n + EXTRABYTES), pgsize,