commit 2d6091417bf60846c6332ad737f363a6d55a625c
parent 32e3a82407ed28a814bf57c1a23d9a9eac322dae
Author: qorg11 <qorg@vxempire.xyz>
Date: Wed, 5 Aug 2020 21:44:21 +0200
im a bit dumb you know
Diffstat:
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/head.c b/src/head.c
@@ -11,13 +11,12 @@ head(FILE *file, int lines)
}
int a;
int c = 0;
-
+
while((a = fgetc(file)) != EOF)
{
if(a == '\n')
- {
- ++c;
- }
+ ++c;
+
putchar(a);
if(c == lines)
return lines;
@@ -30,7 +29,7 @@ int
main(int argc, char *argv[])
{
int lines = 10;
- switch(argc)
+ switch(argc)
{
case 1:
head(stdin,lines);