aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2015-05-17 17:16:15 -0400
committerFranklin Wei <git@fwei.tk>2015-05-17 17:16:15 -0400
commitc13b48095f91b6c277854b9970c59c82943af74f (patch)
treea9f9f0d9fdfa4c3158a50857c190393d5a2b03b5 /src/main.c
parentf1b434fd0e76d44056868ea4d2d8fd52138a663b (diff)
downloadmarket-sim-c13b48095f91b6c277854b9970c59c82943af74f.zip
market-sim-c13b48095f91b6c277854b9970c59c82943af74f.tar.gz
market-sim-c13b48095f91b6c277854b9970c59c82943af74f.tar.bz2
market-sim-c13b48095f91b6c277854b9970c59c82943af74f.tar.xz
functionize stuff, INTRODUCES MEMORY LEAKS
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 65249b4..c2f7b64 100644
--- a/src/main.c
+++ b/src/main.c
@@ -58,14 +58,10 @@ int main(int argc, char *argv[])
}
printf("What would you like to do? ");
- char *cmdbuf = NULL;
- size_t cmdlen = 0;
- cmdlen = getline(&cmdbuf, &cmdlen, stdin);
+ char *cmdbuf = read_string();
all_lower(cmdbuf);
- cmdbuf[cmdlen - 1] = '\0';
-
/* find the best command */
int best_command = -1;