diff --git a/Makefile b/Makefile index e6f82d7..1053c2c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -CC = gcc -CFLAGS = -Og -g -Wall -Wextra -Werror +CC ::= gcc +CFLAGS ::= -Og -g -Wall -Wextra -Werror -objects = main.o input.o output.o encode.o +objects ::= $(patsubst %.c, %.o, $(wildcard *.c)) b64 : $(objects) $(CC) -o b64 $(objects) @@ -12,4 +12,4 @@ main.o output.o : output.h .PHONY : clean clean : - rm -f b64 $(objects) + -rm -f b64 $(objects) diff --git a/main.c b/main.c index bc612d5..54098a2 100644 --- a/main.c +++ b/main.c @@ -58,7 +58,7 @@ main(int argc, char *argv[]) fwrite(obuf, sizeof(*obuf), n, (out) ? out : stdout); } } else if (wrp) { - last = 0; + last = '\n'; while ((n = fread(obuf, sizeof(*obuf), OCTETBUF, (in) ? in : stdin))) { n = encode(obuf, n, sbuf, url); last = printw((out) ? out : stdout, sbuf, n);