char *f;
int ret = 0;
- o = old_o = strdup(opts);
+ o = old_o = xstrdup(opts);
/*
* For each user-specified option
/* null-terminate the argument */
*arg++ = '\0';
fx = strchr(arg, ')');
- if (!arg || fx == arg) {
+ if (fx == NULL || fx == arg) {
plog(XLOG_USER, "key %s: Malformed function in \"%s\"", mapkey, f);
continue;
}
}
} else {
if (eq[1] == '\0' || eq == f) {
- /* misformed selector */
+#ifdef notdef
+ /* We allow empty assignments */
plog(XLOG_USER, "key %s: Bad selector \"%s\"", mapkey, f);
+#endif
continue;
}
}
static void
free_op(opt_apply *p, int b)
{
- if (*p->opt) {
- XFREE(*p->opt);
- }
+ XFREE(*p->opt);
}
* Handle common case - no expansion
*/
if (cp == opt) {
- opt = strdup(cp);
+ opt = xstrdup(cp);
} else {
/*
* Finish off the expansion
/*
* Save the expansion
*/
- opt = strdup(expbuf);
+ opt = xstrdup(expbuf);
}
normalize_slash(opt);
#define _AM_OPT_COPY(field) do { \
if (old->field) \
- newopts->field = strdup(old->field); \
+ newopts->field = xstrdup(old->field); \
} while (0)
_AM_OPT_COPY(fs_glob);