Refactoring test.c

This commit is contained in:
Julien Palard 2011-09-22 20:14:43 +02:00
parent 4a735ec4ed
commit 55abb46212
2 changed files with 5 additions and 6 deletions

View File

@ -11,7 +11,7 @@ OBJ = $(SRC:.c=.o)
CC = gcc CC = gcc
INCLUDE = . INCLUDE = .
DEFINE = _GNU_SOURCE DEFINE = _GNU_SOURCE
CFLAGS = -g3 -Wextra -Wstrict-prototypes -Wall -ansi -pedantic -I$(INCLUDE) CFLAGS = -DNDEBUG -g3 -Wextra -Wstrict-prototypes -Wall -ansi -pedantic -I$(INCLUDE)
LIB = -lutil LIB = -lutil
RM = rm -f RM = rm -f

9
test.c
View File

@ -10,17 +10,16 @@
void disp(struct vt100_headless *vt100) void disp(struct vt100_headless *vt100)
{ {
unsigned int y; unsigned int y;
struct vt100_term *term;
const char **lines; const char **lines;
term = vt100->term; lines = vt100_dump(vt100->term);
lines = vt100_dump(term); for (y = 0; y < vt100->term->height; ++y)
for (y = 0; y < term->height; ++y)
{ {
write(1, lines[y], term->width); write(1, lines[y], vt100->term->width);
write(1, "\n", 1); write(1, "\n", 1);
} }
} }
int main(int ac, char **av) int main(int ac, char **av)
{ {
struct vt100_headless *vt100_headless; struct vt100_headless *vt100_headless;