diff options
author | Aaron Ball <nullspoon@iohq.net> | 2015-06-27 10:26:55 -0600 |
---|---|---|
committer | Aaron Ball <nullspoon@iohq.net> | 2015-06-27 10:27:44 -0600 |
commit | dea9798f377df0f79c366f2553cbda5a3324caf4 (patch) | |
tree | 0ad470527b9e139479914d9304f90042dd599fc2 | |
parent | 6b66372a301366629eaac2f6ab606e4c2def497b (diff) | |
download | terminus-dea9798f377df0f79c366f2553cbda5a3324caf4.tar.gz terminus-dea9798f377df0f79c366f2553cbda5a3324caf4.tar.xz |
Removed ctoi function
Oops. Forgot to remove this when switching to atoi. Also removed math.h
include.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/main.c | 28 |
2 files changed, 1 insertions, 29 deletions
@@ -1,7 +1,7 @@ out = terminus all: - cc src/main.c -lm -o $(out) + cc src/main.c -o $(out) debug: make all dbg="-g" @@ -18,7 +18,6 @@ #include <stdlib.h> #include <string.h> #include <time.h> -#include <math.h> /** @@ -35,33 +34,6 @@ long days_to_seconds(int days) { /** - * Converts the given "string integer" to a long datatype. This is useful for - * programs that take command line arguments from the user and they need to - * treats those arguments like actual numbers. - * - * @param intstr Integer string - * - * @return long The integer represented by the given string - */ -long ctoi(char* intstr) { - // TODO: This doesn't work yet - int i = 0; - long out = 0; - - while(intstr[i] != '\0') { - //printf("%d\n", intstr[i] - 48); - if(intstr[i] == '0') { - out += pow(10,i); - } else { - out += (intstr[i] - 48) + pow(10,i); - } - i++; - } - return out; -} - - -/** * TODO */ int get_user_home(char* out) { |