aboutsummaryrefslogtreecommitdiffstats
path: root/timer.c
diff options
context:
space:
mode:
authorEliteTK <tomasz.kramkowski@gmail.com>2014-12-29 01:30:17 +0000
committerEliteTK <tomasz.kramkowski@gmail.com>2014-12-29 01:30:17 +0000
commitecdc45374aecdbcdb5c1d374742d9c528fb8298e (patch)
tree850edf5e8fd9d9d6bf6cfbf913706fb27e876321 /timer.c
parent7636b3f77215cc422b7dbf1d636269bea4b01726 (diff)
downloadc-stuff-ecdc45374aecdbcdb5c1d374742d9c528fb8298e.tar.gz
c-stuff-ecdc45374aecdbcdb5c1d374742d9c528fb8298e.tar.xz
c-stuff-ecdc45374aecdbcdb5c1d374742d9c528fb8298e.zip
More code.
Diffstat (limited to 'timer.c')
-rw-r--r--timer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/timer.c b/timer.c
index b3ca4f9..506af50 100644
--- a/timer.c
+++ b/timer.c
@@ -16,7 +16,7 @@
#include <time.h>
#include <unistd.h>
-unsigned long long int get_seconds(char *);
+unsigned long int get_seconds(char *);
void usage(char *cmd)
{
@@ -32,12 +32,12 @@ int main(int argc, char **argv)
exit(1);
}
- unsigned long long int total_seconds = 0;
+ unsigned long int total_seconds = 0;
for (int i = 1; i < argc; i++)
total_seconds += get_seconds(argv[i]);
- printf("Total time: %llu second(s).\nStarted at: %d\n", total_seconds, time(NULL));
+ printf("Total time: %lu second(s).\nStarted at: %d\n", total_seconds, time(NULL));
sleep(total_seconds);
@@ -51,7 +51,7 @@ int main(int argc, char **argv)
return 0;
}
-unsigned long long int get_seconds(char *code)
+unsigned long int get_seconds(char *code)
{
int length = strlen(code);
if (length < 2) {
@@ -75,5 +75,5 @@ unsigned long long int get_seconds(char *code)
value[length - 1] = '\0';
- return strtoull(value, NULL, 10) * multiplier;
+ return strtoul(value, NULL, 10) * multiplier;
}