aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uxd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/uxd.c b/uxd.c
index 35dd2aa..9094047 100644
--- a/uxd.c
+++ b/uxd.c
@@ -635,8 +635,12 @@ int get_next_byte(void) {
if(dump_data_arg) {
/* have to cast this to unsigned char and back to int,
to emulate fgetc() */
- c = (unsigned char)dump_data_arg[dump_data_idx++];
- if(!c) c = EOF;
+ c = (unsigned char)dump_data_arg[dump_data_idx];
+ if(c) {
+ dump_data_idx++;
+ } else {
+ c = EOF;
+ }
} else {
c = fgetc(input);
}
@@ -863,6 +867,7 @@ void seek_input(void) {
}
}
+/* -i */
void print_info(void) {
printf("\nBytes: %ld\n", byte_count);
printf("Valid characters: %ld\n", char_count);
@@ -890,6 +895,7 @@ void dump_file(void) {
fclose(input);
}
+/* -d */
void dump_data(void) {
int datalen;
@@ -927,7 +933,7 @@ int main(int argc, char **argv) {
if(print_info_opt) /* -i */
print_info();
- if(restore_term) /* -T */
+ if(restore_term) /* -t */
fputs(ESC_UTF8_OFF, stdout);
return 0;