diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-05-04 17:34:24 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-05-04 17:34:24 -0400 |
commit | 6bd021cecd013fe92dbd0fe3a19b8f82c99bcd9c (patch) | |
tree | bd9bea03cb4f76358047be9a66a7741e0ce18c61 | |
parent | b8ee0cba54870ff2f81047c64e1c31018964ebfc (diff) |
chardiff: correctly handle 0xFF byte
-rw-r--r-- | chardiff_post.c | 4 | ||||
-rw-r--r-- | chardiff_pre.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/chardiff_post.c b/chardiff_post.c index 9aa1790..54679ed 100644 --- a/chardiff_post.c +++ b/chardiff_post.c @@ -1,9 +1,9 @@ -/* Copyright (C) 2011-2014 Luke Shumaker <lukeshu@sbcglobal.net> */ +/* Copyright (C) 2011-2015 Luke Shumaker <lukeshu@sbcglobal.net> */ #include <stdio.h> int main (int argc, char* argv[]) { - char c; + int c; while ((c = getchar()) != EOF) { if (c=='\\') { char c2 = getchar(); diff --git a/chardiff_pre.c b/chardiff_pre.c index 9b334e1..2be38f5 100644 --- a/chardiff_pre.c +++ b/chardiff_pre.c @@ -1,9 +1,9 @@ -/* Copyright (C) 2011, 2013-2014 Luke Shumaker <lukeshu@sbcglobal.net> */ +/* Copyright (C) 2011, 2013-2015 Luke Shumaker <lukeshu@sbcglobal.net> */ #include <stdio.h> int main (int argc, char* argv[]) { - char c; + int c; while ((c = getchar()) != EOF) { switch (c) { case '\n': puts("\\n"); break; |