summaryrefslogtreecommitdiff
path: root/startmode.c
diff options
context:
space:
mode:
authorOskar <>2024-03-26 21:36:34 +0100
committerOskar <>2024-03-26 21:36:34 +0100
commit37493581668294ac136df42f56a0bb937890805a (patch)
treecc61608d9a18cb25ac4cd5916c612a8fc570c0c8 /startmode.c
parent62e97f01ca386de306ecdbda509474a06e4e4c18 (diff)
vimmn seems ok now, alot of cases that should technically fail do get past this function but thats out of the scope for it anyway so its fine. Alot of the cases it fails should already be covered by the functions before it.
Diffstat (limited to 'startmode.c')
-rw-r--r--startmode.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/startmode.c b/startmode.c
index e9064f4..821610a 100644
--- a/startmode.c
+++ b/startmode.c
@@ -25,13 +25,14 @@ int ncat(char filename[]) {
return 0;
}
-int display_name_linecount(char *filename, uint64_t Flines) {
+int display_name_linecount(char *filename) {
+ uint64_t Flines;
int returnval = count_lines_in_file(filename, &Flines);
if (returnval == 1) {
return 1;
}
- fprintf(stdout,"%s %lu lines\n", filename, Flines);
+ fprintf(stdout,"%s %ld lines\n", filename, Flines);
return 0;
}
@@ -39,7 +40,7 @@ int display_name_linecount(char *filename, uint64_t Flines) {
int startmode(char filename[]) {
// The entry to the program. Count lines and display the count. Also show which file is being edited.
uint64_t Flines;
- int dnl = display_name_linecount(filename, Flines);
+ int dnl = display_name_linecount(filename);
if (dnl == 1) {
return EXIT_FAILURE;
}
@@ -139,7 +140,7 @@ int startmode(char filename[]) {
case 'C':
case 'c':
- int dnl = display_name_linecount(filename, Flines);
+ int dnl = display_name_linecount(filename);
if (dnl == 1) {
return EXIT_FAILURE;
}