aboutsummaryrefslogtreecommitdiffstats
path: root/P1
diff options
context:
space:
mode:
authorMatt Strapp <strap012@umn.edu>2020-10-05 20:05:45 -0500
committerMatt Strapp <strap012@umn.edu>2020-10-05 20:05:45 -0500
commitd2c3b21f1d8f8acca272f9a29fda41a18397f786 (patch)
tree5c3ae320524f8bb636c380fa4841643a62099675 /P1
parentWorkaround? (diff)
downloadcsci4061-d2c3b21f1d8f8acca272f9a29fda41a18397f786.tar
csci4061-d2c3b21f1d8f8acca272f9a29fda41a18397f786.tar.gz
csci4061-d2c3b21f1d8f8acca272f9a29fda41a18397f786.tar.bz2
csci4061-d2c3b21f1d8f8acca272f9a29fda41a18397f786.tar.lz
csci4061-d2c3b21f1d8f8acca272f9a29fda41a18397f786.tar.xz
csci4061-d2c3b21f1d8f8acca272f9a29fda41a18397f786.tar.zst
csci4061-d2c3b21f1d8f8acca272f9a29fda41a18397f786.zip
Add a define
Diffstat (limited to 'P1')
-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");