diff --git a/Makefile b/Makefile index ab107bc..7fa9752 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ all: test test: test.c uprintf.c uprintf.h - gcc -std=c99 -Os -o test test.c uprintf.c + gcc -std=c89 -Os -o test test.c uprintf.c clean: rm -rf test diff --git a/uprintf.c b/uprintf.c index c1ac216..82da79a 100644 --- a/uprintf.c +++ b/uprintf.c @@ -66,12 +66,12 @@ static int l_strlen(const char *str) /* Helper functions for p() */ static void print_string(put_char_func pc, const char *str, int width, char wchr) { - int sl; + int sl, w; if (width < 0) { sl = l_strlen(str); - for (int w = -width; w > sl; w --) + for (w = -width; w > sl; w --) pc(wchr); } @@ -80,7 +80,7 @@ static void print_string(put_char_func pc, const char *str, int width, char wchr if (width > 0) { - for (int w = width; w > sl; w --) + for (w = width; w > sl; w --) pc(wchr); } } diff --git a/uprintf.h b/uprintf.h index 1104de5..5e0662e 100644 --- a/uprintf.h +++ b/uprintf.h @@ -12,4 +12,4 @@ void pp(put_char_func pc, const char *fmt, ...); void p(const char *fmt, ...); int psn(char *str, int size, const char *fmt, ...); -#endif // _UPRINTF +#endif /* _UPRINTF */