diff options
author | EliteTK <tomasz.kramkowski@gmail.com> | 2014-12-29 01:30:17 +0000 |
---|---|---|
committer | EliteTK <tomasz.kramkowski@gmail.com> | 2014-12-29 01:30:17 +0000 |
commit | ecdc45374aecdbcdb5c1d374742d9c528fb8298e (patch) | |
tree | 850edf5e8fd9d9d6bf6cfbf913706fb27e876321 /timer.c | |
parent | 7636b3f77215cc422b7dbf1d636269bea4b01726 (diff) | |
download | c-stuff-ecdc45374aecdbcdb5c1d374742d9c528fb8298e.tar.gz c-stuff-ecdc45374aecdbcdb5c1d374742d9c528fb8298e.tar.xz c-stuff-ecdc45374aecdbcdb5c1d374742d9c528fb8298e.zip |
More code.
Diffstat (limited to 'timer.c')
-rw-r--r-- | timer.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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; } |