In most cases, using feof() is a mistake - and this program perfectly demonstrates this in this main loop:
char temp[1048576]; do { if (!strcmp(argv[1], "serifb")) transpose(fgets(temp, 1048576, stdin), 119808 - 'A', 119834 - 'a', 120782 - '0'); else if (!strcmp(argv[1], "serifi")) transpose(fgets(temp, 1048576, stdin), 119860 - 'A', 119886 - 'a', 0); else if (!strcmp(argv[1], "serifbi")) transpose(fgets(temp, 1048576, stdin), 119912 - 'A', 119938 - 'a', 0); else if (!strcmp(argv[1], "sans")) transpose(fgets(temp, 1048576, stdin), 120224 - 'A', 120250 - 'a', 120802 - '0'); else if (!strcmp(argv[1], "sansb")) transpose(fgets(temp, 1048576, stdin), 120276 - 'A', 120302 - 'a', 120812 - '0'); else if (!strcmp(argv[1], "sansi")) transpose(fgets(temp, 1048576, stdin), 120328 - 'A', 120354 - 'a', 0); else if (!strcmp(argv[1], "sansbi")) transpose(fgets(temp, 1048576, stdin), 120380 - 'A', 120406 - 'a', 0); else if (!strcmp(argv[1], "mono")) transpose(fgets(temp, 1048576, stdin), 120432 - 'A', 120458 - 'a', 120822 - '0'); else if (!strcmp(argv[1], "fullwidth")) transposeBlock(fgets(temp, 1048576, stdin), '!', '~', 65281 - '!'); else return help(); } while(!feof(stdin));
At the end of the file, fgets() will return NULL , and then the next call to feof() will return true. Thus, the correct approach is to check the return value of your input function - and since you are doing this test anyway, there is no need to call feof() (unless you want to distinguish the file error from the end of the file).
char temp[1048576]; while (fgets(temp, sizeof temp, stdin) != NULL) { if (!strcmp(argv[1], "serifb")) transpose(temp, 119808 - 'A', 119834 - 'a', 120782 - '0'); else if (!strcmp(argv[1], "serifi")) transpose(temp, 119860 - 'A', 119886 - 'a', 0); else if (!strcmp(argv[1], "serifbi")) transpose(temp, 119912 - 'A', 119938 - 'a', 0); else if (!strcmp(argv[1], "sans")) transpose(temp, 120224 - 'A', 120250 - 'a', 120802 - '0'); else if (!strcmp(argv[1], "sansb")) transpose(temp, 120276 - 'A', 120302 - 'a', 120812 - '0'); else if (!strcmp(argv[1], "sansi")) transpose(temp, 120328 - 'A', 120354 - 'a', 0); else if (!strcmp(argv[1], "sansbi")) transpose(temp, 120380 - 'A', 120406 - 'a', 0); else if (!strcmp(argv[1], "mono")) transpose(temp, 120432 - 'A', 120458 - 'a', 120822 - '0'); else if (!strcmp(argv[1], "fullwidth")) transposeBlock(temp, '!', '~', 65281 - '!'); else return help(); }