From d2c3b21f1d8f8acca272f9a29fda41a18397f786 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Mon, 5 Oct 2020 20:05:45 -0500 Subject: Add a define --- P1/include/mapper.h | 1 + P1/src/mapper.c | 4 ++-- 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"); -- cgit v1.2.3