caio.co/de/fuzzyclock

Remove newline character from get_fuzzy_time result

Id
c6d9f24bbdc662bad1baf8bd9b135b4eb8db7083
Author
Caio
Commit time
2012-03-27T20:46:31-03:00

Modified src/fuzzyclock.c

@@ -18,18 +18,18
};

char* FUZZY_MSG[] = {
- "%s o' clock\n",
- "five past %s\n",
- "ten past %s\n",
- "quarter past %s\n",
- "twenty past %s\n",
- "twenty five past %s\n",
- "half past %s\n",
- "twenty five to %s\n",
- "twenty to %s\n",
- "quarter to %s\n",
- "ten to %s\n",
- "five to %s\n",
+ "%s o' clock",
+ "five past %s",
+ "ten past %s",
+ "quarter past %s",
+ "twenty past %s",
+ "twenty five past %s",
+ "half past %s",
+ "twenty five to %s",
+ "twenty to %s",
+ "quarter to %s",
+ "ten to %s",
+ "five to %s",
};

char* const get_hour_string(int hour) {

Modified src/main.c

@@ -7,6 +7,6
char msg[MAX_MSG_SIZE];
time_t now = time(NULL);
get_fuzzy_time(localtime(&now), msg);
- printf(msg);
+ printf("%s\n", msg);
return 0;
}