aboutsummaryrefslogtreecommitdiffstats
path: root/P1
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--P1/include/mapper.h1
-rw-r--r--P1/src/mapper.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/P1/include/mapper.h b/P1/include/mapper.h
index 2e3693c..bbc6ef1 100644
--- a/P1/include/mapper.h
+++ b/P1/include/mapper.h
@@ -6,6 +6,7 @@
// ###### DO NOT REMOVE ######
#define MAXKEYSZ 100
#define MAXVALUESZ 100
+#define BUFFSIZE 150
// ###### DO NOT REMOVE ######
char *mapOutDir;
diff --git a/P1/src/mapper.c b/P1/src/mapper.c
index 41de345..8ba14a1 100644
--- a/P1/src/mapper.c
+++ b/P1/src/mapper.c
@@ -108,14 +108,14 @@ void writeIntermediateDS() {
while(tempNode != NULL) {
// Get string of 1's associated with the word
- char ones[100]= "";
+ char ones[BUFFSIZE]= "";
tempNode2 = tempNode -> value;
while(tempNode2 != NULL) {
strcat(ones, "1 ");
tempNode2 = tempNode2 -> next;
}
// Shove word and ones in a file named word.txt
- char filename[150] = "";
+ char filename[BUFFSIZE] = "";
//sprintf(filename, "output/MapOut/Map_%d/%s.txt", mapperID, tempNode -> key);
sprintf(filename, "%s/%s.txt", mapOutDir, tempNode -> key);
FILE* fptr = fopen(filename, "w");