From 1fc291bc27c00ee9c949df8cc1fda341afdf0c31 Mon Sep 17 00:00:00 2001 From: Soikk <76824648+Soikk@users.noreply.github.com> Date: Tue, 31 Aug 2021 03:04:55 +0200 Subject: [PATCH] Update wordfinder.c Updated it so that when the word is only found on one line, it writes "line" in the singular --- wordfinder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wordfinder.c b/wordfinder.c index e4849bc..532901f 100644 --- a/wordfinder.c +++ b/wordfinder.c @@ -66,7 +66,7 @@ void printLineData(lineData lineData){ } void printData(Data data){ - printf("Found \"%s\" in %d lines:\n", data.name, data.lines); + printf("Found \"%s\" in %d line%s:\n", data.name, data.lines, (data.lines>1)?"s":""); for(int i = 0; i < data.lines; i++){ printf("\t-At line %d:\n", data.lineList[i].lineNumber); printLineData(data.lineList[i]); -- 2.39.5