Skip to content

Commit fac3f76

Browse files
committed
lib/format.c: fix parsing empty default string
1 parent 02f7bcd commit fac3f76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/format.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ parse_default(const char **pos, struct xbps_fmt *fmt, struct strbuf *buf,
264264
*pos = p;
265265
def->type = XBPS_FMT_DEF_STR;
266266
if (buf == &buf2) {
267-
def->val.str = strdup(buf2.mem);
267+
def->val.str = strdup(buf2.mem ? buf2.mem : "");
268268
if (!def->val.str) {
269269
r = -errno;
270270
goto err;

0 commit comments

Comments
 (0)