Skip to content

Commit 09dafae

Browse files
authored
kfc.c: cleanup
1 parent a891be0 commit 09dafae

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kfc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#include <dirent.h>
22
#include <getopt.h>
3+
#include "kfc.h"
34
#include <stdio.h>
45
#include <stdlib.h>
56
#include <string.h>
67
#include <sys/stat.h>
78
#include <time.h>
89
#include <unistd.h>
9-
#include "kfc.h"
1010

1111

1212
int
@@ -88,13 +88,13 @@ list_palette(void)
8888

8989
if (p.dr == NULL)
9090
{
91-
printf("Could not open directory");
91+
fprintf(stderr, "Could not open directory");
9292
return 1;
9393
}
9494

9595
while((de = readdir(p.dr)) != NULL)
9696
{
97-
printf("%s\n", de->d_name);
97+
puts(de->d_name);
9898
}
9999

100100
closedir(p.dr);
@@ -109,7 +109,7 @@ random_palette(void)
109109
p.randf = 0;
110110
if (p.dr == NULL)
111111
{
112-
printf("Could not open directory");
112+
fprintf(stderr, "Could not open directory");
113113
return 1;
114114
}
115115

@@ -141,7 +141,7 @@ print_palette(void)
141141
p.line = malloc(sizeof(char) * p.len);
142142
p.fp = fopen(p.CCUR, "r");
143143
fgets(p.line,p.len, p.fp);
144-
printf("\nUsing: %s\n", p.line);
144+
puts(p.line);
145145
fclose(p.fp);
146146
for (p.i = 0; p.i < 15; p.i++)
147147
{
@@ -152,7 +152,7 @@ print_palette(void)
152152
printf("\n");
153153
}
154154
}
155-
printf("\n\n");
155+
printf("\n");
156156
return 0;
157157
}
158158

0 commit comments

Comments
 (0)