diff options
author | Matt Strapp <strap012@umn.edu> | 2020-10-04 10:38:27 -0500 |
---|---|---|
committer | Matt Strapp <strap012@umn.edu> | 2020-10-04 10:38:27 -0500 |
commit | 88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04 (patch) | |
tree | 75fed135838f24d9de2baed89e9b5c5b43664d9c /P1 | |
parent | Merge branch 'master' of github.umn.edu:STRAP012/csci4061Projects (diff) | |
download | csci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.tar csci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.tar.gz csci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.tar.bz2 csci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.tar.lz csci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.tar.xz csci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.tar.zst csci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.zip |
Fix compiler warnings
Diffstat (limited to 'P1')
-rw-r--r-- | P1/src/mapreduce.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/P1/src/mapreduce.c b/P1/src/mapreduce.c index d6094ac..9fad791 100644 --- a/P1/src/mapreduce.c +++ b/P1/src/mapreduce.c @@ -31,7 +31,9 @@ int main(int argc, char *argv[]) { mapperPid = fork(); if (mapperPid > 0) { //TODO: exec here - execl("./mapper", "./mapper", i, NULL); + char num[10]; + sprintf(num, "%d", i); + execl("./mapper", "./mapper", num, NULL); } } @@ -59,8 +61,8 @@ int main(int argc, char *argv[]) { reducerPid = fork(); if (reducerPid > 0) { //TODO: exec here - char* num[10]; - sprintf(&num, "%d", i); + char num[10]; + sprintf(num, "%d", i); execl("./reducer", "./reducer", &num, NULL); } } |