Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 19fdb97

Browse files
committed
check glob return
1 parent 1e7e8a6 commit 19fdb97

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/paleta.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ struct buf {
1616

1717
static void pal_write(const char *str) {
1818
glob_t buf;
19-
glob(PTS_GLOB, GLOB_NOSORT, NULL, &buf);
19+
int ret;
20+
21+
ret = glob(PTS_GLOB, GLOB_NOSORT, NULL, &buf);
22+
23+
if (ret != 0) {
24+
die("glob %s failed", PTS_GLOB);
25+
}
2026

2127
for (size_t i = 0; i < buf.gl_pathc; i++) {
2228
FILE *f = fopen(buf.gl_pathv[i], "w");

0 commit comments

Comments
 (0)