- strcat(command, " | wc -l");
- FILE *countSpaces = popen(command, "r");
- char* buffer = (char*)calloc(32, sizeof(char));
- fgets(buffer, sizeof(buffer), countSpaces);
- int n = atoi(buffer) + 1;
- free(buffer);
- pclose(countSpaces);
+ FILE *arraySize = popen(command, "r");
+ char* bufferNum = (char*)calloc(64, sizeof(char));
+ fgets(bufferNum, sizeof(bufferNum), arraySize);
+ int n = atoi(bufferNum);
+ pclose(arraySize);