diff options
author | Oskar <[email protected]> | 2023-11-19 22:58:00 +0100 |
---|---|---|
committer | Oskar <[email protected]> | 2023-11-19 22:58:00 +0100 |
commit | 5f973bc0b3a0d1ddbb33cc83c74ad6fa39688a9a (patch) | |
tree | dd0fce16458344249b901513d650d652ecdb0e42 /startmode.c | |
parent | c79c2b6b2aa7b8d259044bc9f90c0eee16a9bc0a (diff) |
minor fixes, changed some variables and stuff
Diffstat (limited to 'startmode.c')
-rw-r--r-- | startmode.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/startmode.c b/startmode.c index 988b6fd..1ecaa94 100644 --- a/startmode.c +++ b/startmode.c @@ -4,6 +4,7 @@ #include <string.h> #include <errno.h> #include "7ed.h" +#include <stdint.h> int NCAT(char filename[]) { @@ -26,18 +27,18 @@ int NCAT(char filename[]) { int startmode(char filename[]) { - size_t Flines; + uint64_t Flines; int returnval = COUNT_LINES_IN_FILE(filename, &Flines); if (returnval == 1) { return EXIT_FAILURE; } - fprintf(stdout,"%s %ld lines\n", filename, Flines); + fprintf(stdout,"%s %lu lines\n", filename, Flines); - long focus = 1; + uint64_t focus = 1; while(1) { - fprintf(stdout, "(%ld): ", focus); + fprintf(stdout, "(%lu): ", focus); char command = getchar(); if (command == '\n') { continue; @@ -47,7 +48,7 @@ int startmode(char filename[]) { switch (command) { case 'L': case 'l': - long Lfocus; + uint64_t Lfocus; char buf[1024]; int success; @@ -81,8 +82,8 @@ int startmode(char filename[]) { } while (!success); - if (Lfocus < 1 || Lfocus > (long)Flines) { - fprintf(stderr, "L is either less than 1 or more than %ld\n", Flines); + if (Lfocus < 1 || Lfocus > Flines) { + fprintf(stderr, "L is either less than 1 or more than %lu\n", Flines); } else { focus = Lfocus; } @@ -111,12 +112,12 @@ int startmode(char filename[]) { case 'C': case 'c': - size_t CFlines; + uint64_t CFlines; int returnval = COUNT_LINES_IN_FILE(filename, &CFlines); if (returnval == 1) { return EXIT_FAILURE; } - fprintf(stdout,"%s %ld lines\n", filename, CFlines); + fprintf(stdout,"%s %zu lines\n", filename, CFlines); break; case 'Q': |