From 88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Sun, 4 Oct 2020 10:38:27 -0500 Subject: Fix compiler warnings --- P1/src/mapreduce.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'P1/src') 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); } } -- cgit v1.2.3