mirror of
https://github.com/tat3r/tdfiglet.git
synced 2024-11-14 12:16:41 +00:00
bugchasing with sloth
This commit is contained in:
parent
c4ba32550d
commit
0acf59403f
3
Makefile
3
Makefile
@ -1,12 +1,11 @@
|
|||||||
PROG := tdfiglet
|
PROG := tdfiglet
|
||||||
SRC := tdfiglet.c
|
SRC := tdfiglet.c
|
||||||
CC := cc
|
CC ?= cc
|
||||||
CFLAGS += -std=c99 -Wall
|
CFLAGS += -std=c99 -Wall
|
||||||
|
|
||||||
UNAME := $(shell sh -c 'uname -s 2>/dev/null')
|
UNAME := $(shell sh -c 'uname -s 2>/dev/null')
|
||||||
|
|
||||||
ifeq ($(UNAME),Darwin)
|
ifeq ($(UNAME),Darwin)
|
||||||
CC := clang
|
|
||||||
CFLAGS += -Wunused-result -Wunused-value
|
CFLAGS += -Wunused-result -Wunused-value
|
||||||
LDFLAGS += -liconv
|
LDFLAGS += -liconv
|
||||||
endif
|
endif
|
||||||
|
11
tdfiglet.c
11
tdfiglet.c
@ -224,12 +224,20 @@ font_t
|
|||||||
exit(EX_NOINPUT);
|
exit(EX_NOINPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
stat(fn, &st);
|
if (stat(fn, &st)) {
|
||||||
|
perror(NULL);
|
||||||
|
exit(EX_OSERR);
|
||||||
|
}
|
||||||
|
|
||||||
len = st.st_size;
|
len = st.st_size;
|
||||||
|
|
||||||
map = mmap(0, len, PROT_READ, MAP_PRIVATE, fd, 0);
|
map = mmap(0, len, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||||
|
|
||||||
|
if (!map) {
|
||||||
|
perror(NULL);
|
||||||
|
exit(EX_OSERR);
|
||||||
|
}
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
if (!font) {
|
if (!font) {
|
||||||
@ -341,7 +349,6 @@ readchar(int i, glyph_t *glyph, font_t *font)
|
|||||||
ch = ' ';
|
ch = ' ';
|
||||||
row++;
|
row++;
|
||||||
col = 0;
|
col = 0;
|
||||||
color = 0;
|
|
||||||
} else {
|
} else {
|
||||||
color = *p;
|
color = *p;
|
||||||
p++;
|
p++;
|
||||||
|
Loading…
Reference in New Issue
Block a user