summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-05-04 17:34:24 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-05-04 17:34:24 -0400
commit6bd021cecd013fe92dbd0fe3a19b8f82c99bcd9c (patch)
treebd9bea03cb4f76358047be9a66a7741e0ce18c61
parentb8ee0cba54870ff2f81047c64e1c31018964ebfc (diff)
chardiff: correctly handle 0xFF byte
-rw-r--r--chardiff_post.c4
-rw-r--r--chardiff_pre.c4
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;